Note that there are some explanatory texts on larger screens.

plurals
  1. POAdobe Flex Builder 3 : Cannot add any method/function to any class of an existing project?
    text
    copied!<p>I'm totally new to Adobe Flex Builder 3. I've been assigned a fully functional project but when I want to add the simplest function to any class, I always got the same error :</p> <blockquote> <p>Call to a possibly undefined method through a reference with static type</p> </blockquote> <p>For example, in some random class there is a function defined like this :</p> <pre><code>public function GetID() :String { return m_strID; } </code></pre> <p>If I try to define a new one like below :</p> <pre><code>public function GetIDFoo() :String { return m_strID; } </code></pre> <p>And then I try to call both of them like this :</p> <pre><code>trace ("This line is ok : " + oPhysicalScreen.GetID()); trace ("This line gives me an error : " + oPhysicalScreen.GetIDFoo()); </code></pre> <p>Any clue?</p> <p>Regards, Michel</p> <p>PS: full code where I do the call : </p> <pre><code>public function UpdatePhysicalScreenData(oScreenNode:XML):void { if (m_vPhysicalScreens == null) { return; } var oScreenList:CMultyList = m_rBasicScreen.GetPhysicalScreensPanel().GetScreenList(); var oPhysicalScreen:CPhysicalScreen = FindPhysicalScreen(oScreenNode.@id); if (oPhysicalScreen == null) { oPhysicalScreen = new CPhysicalScreen(); { oPhysicalScreen.Initialize(oScreenNode.@id); oPhysicalScreen.SetInfo(oScreenNode.@info); var eList:uint = oScreenNode.@list; if (eList &lt; SCREENS_LIST_TITLES.length) { oScreenList.SelectCurrentList(eList); } else { oScreenList.SelectCurrentList(2);//Test } var oNewEntry:CEntry = oScreenList.CreateEntryInCurrentList(oPhysicalScreen.GetID() + " " + oPhysicalScreen.GetInfo(), oPhysicalScreen); //var oNewEntry:CEntry = oScreenList.CreateEntryInCurrentList(oPhysicalScreen.GetDisplayName(), oPhysicalScreen); oNewEntry.ChangeTextColor(CPanelPhysicalScreens.STATE_COLORS[oPhysicalScreen.GetState()]); } m_vPhysicalScreens.AddAtEnd(oPhysicalScreen); } if (oPhysicalScreen != null) { //should never be null but ... trace ("UpdatePhysicalScreenData : " + oPhysicalScreen.GetID() + " " + oPhysicalScreen.GetInfo() + " State : "+ oPhysicalScreen.GetState()); trace ("UpdatePhysicalScreenData : " + oPhysicalScreen.GetIDFoo() + " " + oPhysicalScreen.GetInfo() + " State : "+ oPhysicalScreen.GetState()); } oPhysicalScreen.SetDiffusionCode(oScreenNode.@diffusionCode); oPhysicalScreen.SetCurrentSequence((int)(oScreenNode.@currentSequence)); oPhysicalScreen.SetIsAlive(oScreenNode.@alive == "true"); } </code></pre> <p>Start of class definition :</p> <pre><code>public class CPhysicalScreen { public static var STATE_UNUSED :uint = 0; public static var STATE_SYNC :uint = 1; public static var STATE_UNSYNC :uint = 2; public static var STATE_KO :uint = 3; public static var STATE_MAX_WAIT_TIME :uint = 5000; private var m_strID :String; private var m_eState :uint; private var m_strInfo :String; private var m_strDiffusionCode :String; private var m_uiCurrentSequence :int; private var m_bIsAlive :Boolean; public function CPhysicalScreen() { super(); m_strID = null; m_eState = STATE_UNUSED; m_strInfo = ""; m_strDiffusionCode = ""; m_uiCurrentSequence = 0; m_bIsAlive = false; } public function GetID() :String { return m_strID; } public function GetIDFoo() :String { return m_strID; } </code></pre> <p>...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload