Tallking between classes

Hello

I push a settingScreen of the screen to display the page setting.

The problem is: when the user once the definition of preference on the setting screen, the settingScreen was then pop off, I want to call some processing subroutine in the screen. How to communicate for settingScreen screen?

Please notify.

Otherwise, press the setting screen using a modal button, then when the screen is skipped, control will return to the main screen of treatment that can act as good seems it.

That said, I do not use modal screens because they tie up a Thread, then maybe this does not work for you.

Tags: BlackBerry Developers

Similar Questions

  • Link between classes: reference error

    Hello

    I am yet to try to create a movie clip to a list of objects appear on the scene and ask the user to interact with them.

    It will be my class of loop of game called "LetterArray()".

    My main class is called 'BugGoopFSGame() '.

    After that I added the line of code below in my LetterArray(). in the class file, I get the below error message:

    Code is entered:

    private var lettersL1:Array = new Array (a, f, g, h, i, n, o, s, t);

    It comes to getting the error message:

    ReferenceError: Error #1069: property [object T] not found on S and there is no default value.

    at LetterArray()

    at BugGoopFSGame()

    I do not know the reference I use between the two files are not good. Can you please tell me what code I need to add and where.

    Thanks for your help!

    Images of recommended

    This is the code in my main class - BugGoopFSGame()

    package

    {

    import flash.display. *;

    import flash.utils.Timer;

    import flash.events. *;

    import flash.events.MouseEvent;

    import flash.media.Sound;

    import flash.events.Event;

    import flash.media.SoundChannel;

    import flash.media.SoundMixer;

    import flash.media.SoundTransform;

    import flash.text. *;

    import flash.net.URLRequest;

    SerializableAttribute public class BugGoopFSGame extends MovieClip

    {

    public var mybackground:BackGround;

    public var letterArray:LetterArray = new LetterArray (internship); / / This, this is how I connect principal to gameloop

    It is of the early in my gameloop class - LetterArray()

    package

    {

    import flash.display. *;

    import flash.events. *;

    import flash.text. *;

    import flash.utils.Timer;

    import flash.media.Sound;

    import flash.media.SoundChannel;

    import flash.net.URLRequest;

    SerializableAttribute public class extends MovieClip LetterArray

    {

    private var _stage:Stage; //this reference works well for the main file. Should I somehow a link to code mechanically below?

    / * Movie clips that need to go in a table * /.

    level 1

    public var a: A = new A();

    public var f: F = new F();

    public var g:G = new G();

    public var h:H = new H();

    public var I: I = new I();

    public var n: n = new N();

    public var o: O = new O();

    public var changement = new foo();

    public var t:T = new T();

    private var letterArray:Array;

    private var lettersL1:Array = new Array (a, f, g, h, i, n, o, s, t); //this is the line causing the error. I don't know it's because I need to add something to the main class.

    This loop must be in a function body.  for example, use:

    package

    {

    import flash.display. *;

    import flash.events. *;

    import flash.text. *;

    import flash.utils.Timer;

    import flash.utils.getDefinitionByName;

    import flash.media.Sound;

    import flash.media.SoundChannel;

    import flash.net.URLRequest;

    SerializableAttribute public class extends MovieClip LetterArray

    {

    private var lettersL1:Array = new Array [A, F, G, H, I, N, O, S, T]. Here are the video clips, for which classes were created dynamically by Flash

    public void LetterArray {}

    for (var i: int = 0; i //Line 21 )

    {

    var:Class=Class(getDefinitionByName(lettersL1[i])) C;

    var c: * = new C(); create instances of classes in lettersL1

    do everything with c

    }

    }

    }

  • pass variables between classes

    Hello! I'm new to flash actionscript and I make a small game right now. I thought to create separate movieclips for each level of play and their assigned separate classes is cleaner and easier to code.

    for example: -.

    level 1 - level1.as

    level 2 - level2.as

    Level3 - level3.as

    My problem is how to pass variables (such as health, score, etc.) to a higher level?

    Please help I'm stuck on this and I have searched a lot but couldn't get the right answer...

    Oh, and I use cs3 flash with actionscript 3.0

    I don't think you really understand what are classes and movieclips.

    MovieClips are display objects; your character, the enemy, elements, platforms< these="" will="" be="">

    Classes can be used to define new elements or extend those which already exist, such as an object or a MovieClip.

    For the purposes of making a game, I would separate levels of executives.

    do level 1 on a frame labeled "level 1".

    and level 2 on a frame labeled "level 2".

    variables will carry an image to the image.

    Use gotoAndStop (frame_label) to switch between levels

    * Make sure you use stop(); on the first image to prevent bike between the frames.

    * You can make the frames between each level that has the code "gotoAndStop(previous level)" to prevent people to hit 'play' on the swf file and the cycling through your levels.

    You can also search for SharedObjects as a method of storage of variables even after that the swf file is closed.

  • Event not to be heard between classes

    Hey all,.

    I have run in a matter where a custom event is not heard between objects.

    Here is my set up: I have two classes, game board, and InstructionsBoard, each is associated with the library, in the properties panel as a class to clips on the stage.

    I send my GameBaord class event:

    dispatchEvent (new CustomEvent (CustomEvent.ANIMATION_DONE));

    and wait for it in my InstructionsBoard class:

    com of the packaging. SettingflipGame

    {

    import flash.display.MovieClip;

    import com. SettingflipGame.CustomEvent;

    /public class InstructionsBoard extends MovieClip

         {

    public void InstructionsBoard()

              {

    this.addEventListener (CustomEvent.ANIMATION_DONE, SlideInstructionsBaord, true);

              }

    private function SlideInstructionsBaord(event:CustomEvent):void

              {

    trace ("Slide out board");

              }

         }

    }

    It traces never ' Slide out board.

    Thank you guys

    only one instance of your class of GameBaord (sic) can listen to an event sent by this instance.

  • question on communication between classes

    I am trying to learn AS3 and am confused as to whether you can communicate between the class of document and other classes in a program or if you can communicate between the two classes in a program by using the getters and setters. Whenever I try it I always get errors. Thank you

    Please check the answers then!

  • AS 3.0 - &amp; gt; communication between classes

    Hi all

    Here's a good question, that nobody seems to have all the answers for... I searched on the net and it is not really that much info at all, so I'm assuming that we AS 3.0 people do a little "trail blazing", so to speak.

    Here's my problem:

    I would have a particularly modular interface, such as the main movieclip can load in modular pieces and insert them in a framework and have this operation as a 'window' in the Flash. The charger for the movieclip must be dynamic. I'll abstain not harder and get to the point of my question:

    Let's say you have created a class to a movieclip 'circle', which is created in its very own .fla with its own (circle.as) class file that extends the movieclip class. Now let's consider this circle is one of the modules in the base movieclip that will load dynamically.

    The circle movieclip loads, but now you want to communicate with the movieclip of circle and for example, question him and ask him what color his circle is. Surely, we would create a function in the circle class, something like the following:
    public void getColor (): {of color
    Return circlecolor;
    };

    On the main movieclip, we questioned this file that has been loaded, and you can imagine the code to resemble the following:
    public void objectLoaded(event:Event):void {}
    trace ("circleloaded! And Flash coders rule! ») ;
    trace ("the color of this new object is" + event.content.getColor ());
    };

    Now my problem is that I can't connect at all! Test and debugging, it seems that the film circle will not even look at the scene as the root timeline (it will look at the charger as its personal root, I think!). Does anyone have ideas on how we can get some kind of a channel of communication between the classes of movieclip that are loaded dynamically in this mode?


    Yes sorry I forgot:
    You must send the object to a MovieClip for her to work. Full code:

    the Circle.as class

    package {}
    import flash.display.MovieClip;

    SerializableAttribute public class Circle extends MovieClip {}
    var circlecolor:Number = 0xFF0000;

    public void getColor (): number {}
    Return circlecolor;
    }
    }
    }

    This class must be attached to the document (in my case loaded.swf), use the property inspector.

    The following code goes into the swf loader:

    import flash.events. *;
    import flash.display. *;
    flash.net import. *;

    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener (Event.COMPLETE, onCircleLoaded);
    LDR. Load (new URLRequest ("loaded.swf"));
    addChild (ldr);

    function onCircleLoaded(event:Event):void {}
    trace ("the color is:" + MovieClip (event.target.content) .getColor ());
    }

    That's all

  • Best method to pass a resource between classes

    Hi all

    Relatively new to OOP again and worked on a project of OBJECT-oriented programming.  My basic architecture is a machine to States OOP, each class represents a different test.  I have a test that will go through all the tests, so I thought I could spend just a new class in one for a loop and pass all the tests.  Problem with this is of course I connect to a device and the resource is lost with each new object.  A solution imagined ive because this problem is to have a class that the class test and the resource and I could a new class of group whenever I passed the test and carry the same resource on the wire.

    Any comments welcome, if my overall plan for this program is disabled please tell.

    Thank you

    Matt

    Use a shift register to store your device and have each of your methods to run the Test have an entry for the device object.  You will probably need a couple of tests to initialize device and device close.  These should be the only two cases that open or close your device.  So no dialing is required.

  • OOP communication between classes. Help, please!

    It is a slight continuation to a previous topic I posted.

    Description

    control_Class - is the attached main class dtö the .fla this class contains this line of code

    addChild (levels_bg)

    levels_bg -is a movieClip that has its own class of Levels_BG

    Levels_BG - after user selection his work monitoring

    control_Class.startlevel (e.currentTarget.shape_obj.text_box. (Text);

    which is a function in the control_Class:

    static public void startlevel (levelname:String): String

    {

    trace (LevelName.substr(LevelName.Length-1,LevelName.Length));

    }

    My problem is that when in this function, I can't draw or use one of the functions or variable in control_Class.

    for example.

    static public void startlevel (levelname:String): String

    {

    trace (LevelName.substr(LevelName.Length-1,LevelName.Length));

    RunThis();

    }

    private function runthis (): void

    {

    trace ("it works")

    }

    Hope someone could help me with this. Relatively new to OOP and I don't know if I'm doing this right.

    See you soon,.

    Pavel




    you will need to use static variables in control_Class.  I'm not sure it's a good Setup, but you have no instance control_Class shown in your code.

  • How to pass a variable between classes?

    Hello

    I created a class .as MovieClip to a MovieClip that contains 7 buttons. I use a table of these buttons and an array of labels of image on the timeline of the MovieClip parent to navigate in the labels.

    ...
    
    private function clickHandler(event:MouseEvent):void 
            {
    //Sets the current button listed in the button array    
     currentButton = MovieClip(event.currentTarget);
                index = buttonArray.indexOf(currentButton);
            
    //Uses the index variable to find the corresponding frame label from the label array            
    MovieClip(root).gotoAndStop(labelArray[index]);
            }
    
    ...
    

    This works perfectly.

    Now I have another .as MovieClip class, I created a simple MP3 player MovieClip. I'm pulling in a XML data of each mp3, including the URL, etc... All works perfectly.

    I'm trying to use the variable "index" of the class Nav.as in the class AudioPlayer.as to play the corresponding number of the song. By calling "playSong (index);

    "playSong (index);" works in a test file, when I tested the navigation tables and the corresponding number xml concept. I need to shoot the variable 'index' from Nav.as to AudioPlayer.as.

    ...
    
    private function playSong(mySong:Number):void 
            {            
                var myURL = my_songs[mySong].@URL;        
            
                if (my_channel) {
                    my_channel.stop();
                }
            
                my_sound = new Sound();
                my_sound.load(new URLRequest(myURL));
                my_channel = my_sound.play();
            }
    
    private function onPlay(e:MouseEvent):void {            
         playSong(index);
            }
    

    It works perfectly when tested. For example: "playSong (2)" or "playSong (5)" plays the song number correct.

    Thank you in advance!

    You should not have a currentIndex in each class, simply on the mother of the other 2 classes. When you say 'this.parent' you access the parent display object. This is where you want currentIndex to exist. If both classes are on the same display list then 'this.parent' will be the same parent and therefore the same variable.

    I didn't know what kind of display object container parent was (MovieClip, Sprite, etc.), so I've referenced it let go like: 'object (this.parent) .currentIndex '.

    Should be in NAV. As:

    Object (this.parent) .currentIndex = buttonArray.indexOf (currentButton);

    AudioPlayer.as should be read through:

    playSong (Object (this.parent) .currentIndex);

  • Pass the URLLoader() variable between classes

    I have two classes. See below.

    What I want to do is quite simple, but I do not know how to do. I want the URLFactory for create table and store it in the variable 'dataArray' and use the table in the main class, by calling the GetList() class URLFactory. I have returns nothing... Please help

    Basically, I need to set a variable equal to URLLoader.data (var something: String = URLLoader.data) so I can use this variable in other classes. WHY ISN'T IT EASIER? Please, I beg you. A solution would be much appreciated.

    package classFiles
    {
    import flash.display.MovieClip;
    Import classFiles.URLFactory;

    SerializableAttribute public class MainClass extends MovieClip {}
    private var _UrlDriver:URLFactory;

    public void MainClass() {}
    _UrlDriver = new URLFactory ('url');
    var temp: Array = _UrlDriver.GetList ();

    }

    }

    }

    package classFiles
    {
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.sampler.Sample;

    SerializableAttribute public class extends MovieClip {} URLFactory

    private var loader: URLLoader;
    public var textData:String;
    public var dataArray:Array;

    public void URLFactory(url:String) {}
    textData = "";
    this.dataArray = new Array();
    loader = new URLLoader();
    loader.addEventListener (Event.COMPLETE, HandleComplete);
    Loader.Load (new URLRequest (url));

    Temp = CreateDataArray();
    }

    function HandleComplete(e:Event):void {}

    textData = loader.data;

    trace (dataArray);

    }

    function CreateDataArray (): void {}

    trace (dataArray);
    dataArray = textData.split ("\n");
    dataArray = textData.split('","');
    }

    public void GetList (): Array {}

    return dataArray.

    }
    }

    }

    Yes, the data loading is not instantaneous.  This is why you use a complete listener in your factory.

    Similarly, you must use a listener in your main class to check if the data is ready.

    p.s. Please check the useful/correct.

  • communication between classes

    I have a class calling another class. When the called class is made to do what its supposed to do its supposed to shipping and the event but his throw a type constraint error

    Here's the class using the

    package classes
    {
         import flash.events.Event;
         import flash.events.EventDispatcher;
         
         import mx.collections.ArrayCollection;
         import mx.rpc.events.ResultEvent;
         
         public class InitJobDetails extends EventDispatcher {
              
              public var HTTPC:HttpQueery; //Takes 3 Parameters - Params, Url Method
              private var _params:Object = new Object();
              public var _opsArr:ArrayCollection;
              
              public function InitJobDetails(event:Event) {
              _params["id"] = event.currentTarget.selectedItem.jobid;
              HTTPC = new HttpQueery(_params,"http://10.16.1.53/viewjobops.php","POST");
              HTTPC.addEventListener("Completed", notifymain);
              }
              
              private function notifymain(event:ResultEvent):void {
                   _opsArr = HTTPC._tempArray;
                   dispatchEvent(new Event("notifyMain"));
              }
    
         }
    }
    
    

    and here is the class called

    package classes
    {
         //Takes 3 Parameters - Params, Url Method
         import flash.events.Event;
         import flash.events.EventDispatcher;
         
         import mx.collections.ArrayCollection;
         import mx.rpc.events.ResultEvent;
         import mx.rpc.http.HTTPService;
         
         public class HttpQueery extends EventDispatcher {
              private var params:Object = new Object();
              private var _url:String;
              private var _method:String;
              public var _tempArray:ArrayCollection;
              public var RPF:ResultProxyFix;
              
              public function HttpQueery(Qparams:Object, Qurl:String, Qmethod:String) {
         
                   params = Qparams;
                   _url = Qurl;
                   _method = Qmethod;
                   
                   var QY:HTTPService = new HTTPService;
                   QY.url = _url;
                   QY.method = _method;
                   QY.addEventListener(ResultEvent.RESULT, completed);
                   QY.send(params);
                   }
         
         
         
              private function completed(event:ResultEvent):void {
              RPF = new ResultProxyFix(event);
              _tempArray = RPF.tempArray;
              dispatchEvent(new Event("Completed"));
              }
         }
    }
    
    

    The error is thrown when this class attempts to send the "Completed" event if I have my data on the http request. Am I doing this wrong?

    Below the error is thrown

    TypeError: Error #1034: Type coercion failed: cannot convert flash.events::Event@1d369be1 to mx.rpc.events.ResultEvent.

    to::EventDispatcher/dispatchEventFunction() flash.events

    to::EventDispatcher/dispatchEvent() flash.events

    class::HttpQueery/completed() [/ Users/jorgepease/Documents/Flex Builder 3/ArrowmailJobBoard/src/classes/HttpQueery.as:36]

    to::EventDispatcher/dispatchEventFunction() flash.events

    to::EventDispatcher/dispatchEvent() flash.events

    to mx.rpc::AbstractInvoker /http://www.adobe.com/2006/flex/mx/internal:dispatchRpcEvent ([C:\autobuild\3.2.0\framewor ks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170])

    to mx.rpc::AbstractInvoker /http://www.adobe.com/2006/flex/mx/internal:resultHandler ([C:\autobuild\3.2.0\frameworks\ projects\rpc\src\mx\rpc\AbstractInvoker.as:193])

    at mx.rpc::Responder/result() [C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responde r.as:43]

    at mx.rpc::AsyncRequest/acknowledge() [C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\ AsyncRequest.as:74]

    to DirectHTTPMessageResponder / completeHandler ([C:\autobuild\3.2.0\frameworks\projects\rpc\s rc\mx\messaging\channels\DirectHTTPChannel.as:403])

    to::EventDispatcher/dispatchEventFunction() flash.events

    to::EventDispatcher/dispatchEvent() flash.events

    to flash.net::URLLoader/onComplete()

    Thanks for your help

    private void notifymain(event:ResultEvent):void {}

    Expected a ResultEvent and you are sending an ordinary event

  • Access a public variable between classes

    Hello

    I have two classes running... one is a class of documents (EgoGame.as) and another is a class linked to several similar clips (Ball.as).

    I'm trying to access a public Ball.as variable that has been declared in the class statement EgoGame.as.

    When I run the test output includes the following...

    1120: access of undefined property _ballPlaced.


    Here is my code.  What I'm trying to do is remove the Ball.as event listeners when the _ballPlaced variable is true, so that the user cannot drag and drop the balls after that that they were placed in a box... pointers greatly appreciated!

    Document class
    EgoGame.as

    package
    {
        import flash.display.MovieClip;
        import flash.display.DisplayObject;
        import flash.events.MouseEvent;
        import Ball;
            
        public class EgoGame extends MovieClip
        {
            public var __zoneFull:Array = new Array(false, false, false);
            
            public var __ballPlaced:Array = new Array(false, false, false);
            
            public function EgoGame()
            {
                ball0_mc.addEventListener(MouseEvent.MOUSE_DOWN, zoneEmpty);
                ball1_mc.addEventListener(MouseEvent.MOUSE_DOWN, zoneEmpty);
                ball2_mc.addEventListener(MouseEvent.MOUSE_DOWN, zoneEmpty);
                
                ball0_mc.addEventListener(MouseEvent.MOUSE_UP, zoneFill);
                ball2_mc.addEventListener(MouseEvent.MOUSE_UP, zoneFill);
                ball1_mc.addEventListener(MouseEvent.MOUSE_UP, zoneFill);
                
                ball0_mc.addEventListener(MouseEvent.MOUSE_UP, playMovie);
                ball1_mc.addEventListener(MouseEvent.MOUSE_UP, playMovie);
                ball2_mc.addEventListener(MouseEvent.MOUSE_UP, playMovie);
                
                }
            
            private function zoneEmpty(event:MouseEvent):void
            {
                if(event.target.hitTestObject(zone0_mc) && _zoneFull[0] == true)
                {
                    _zoneFull[0] = false;
                    _ballPlaced[event.target.name.substring(4,5)] = false;
                }
                else if(event.target.hitTestObject(zone1_mc) && _zoneFull[1] == true)
                {
                    _zoneFull[1] = false;
                    _ballPlaced[event.target.name.substring(4,5)] = false;
                }
                else if(event.target.hitTestObject(zone2_mc) && _zoneFull[2] == true)
                {
                    _zoneFull[2] = false;
                    _ballPlaced[event.target.name.substring(4,5)] = false;
                }
                else
                {
                    event.target.x = event.target._startX;
                    event.target.y = event.target._startY;
                    _ballPlaced[event.target.name.substring(4,5)] = false;
                }   
            }
            
            private function zoneFill(event:MouseEvent):void
            {
                if(event.target.hitTestObject(zone0_mc) && _zoneFull[0] == false)
                {
                    event.target.x = zone0_mc.x;
                    event.target.y = zone0_mc.y;
                    _zoneFull[0] = true;
                    _ballPlaced[event.target.name.substring(4,5)] = true;
                }
                else if(event.target.hitTestObject(zone1_mc) && _zoneFull[1] == false)
                {
                    event.target.x = zone1_mc.x;
                    event.target.y = zone1_mc.y;
                    _zoneFull[1] = true;
                    _ballPlaced[event.target.name.substring(4,5)] = true;
                }
                else if(event.target.hitTestObject(zone2_mc) && _zoneFull[2] == false)
                {
                    event.target.x = zone2_mc.x;
                    event.target.y = zone2_mc.y;
                    _zoneFull[2] = true;
                    _ballPlaced[event.target.name.substring(4,5)] = true;
                }
                else
                {
                    event.target.x = event.target._startX;
                    event.target.y = event.target._startY;
                    _ballPlaced[event.target.name.substring(4,5)] =false;
                }
            }
            
            private function playMovie(event:MouseEvent):void
            {
                if (_ballPlaced[0] == true)
                {
                    ball0_mc.gotoAndPlay(2);
                }
                else
                {
                    ball0_mc.gotoAndStop(1);
                }
                
                if (_ballPlaced[1] == true)
                {
                    ball1_mc.gotoAndPlay(2);
                }
                else
                {
                    ball1_mc.gotoAndStop(1);
                }
                
                if (_ballPlaced[2] == true)
                {
                    ball2_mc.gotoAndPlay(2);
                }
                else
                {
                    ball2_mc.gotoAndStop(1);
                }
            }
            
            
        }
    }


    Ball.As

    package
    {
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.display.DisplayObject;
        import EgoGame;
        
        public class Ball extends MovieClip
        {
            // public var _hitTarget:MovieClip;
            public var _startX:Number;
            public var _startY:Number;
            
            public function Ball()
            {
                _startX = this.x;
                _startY = this.y;
                this.buttonMode = true;
                this.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
                this.addEventListener(MouseEvent.MOUSE_UP, dropIt);
            }
            
            private function dragIt(event:MouseEvent):void
            {
                this.startDrag();
            }
            
            public function dropIt(event:MouseEvent):void
            {
                this.stopDrag();
            }
            
            public function lockBall(event:MouseEvent):void
            {
                if(_ballPlaced[this.name.substring(4,5)] == true)
                {
                    this.removeEventListener(MouseEvent.MOUSE_DOWN, dragIt);
                    this.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
                }
            }
            
        }
    }

    each place you have a ball of reference you have access to the lockBall() method.  so, if ball0_mc is a member of Ball class, you can use:

    ball0_mc.lockBall ();

  • Call methods between Classes

    There's a week again to ACE

    I am trying to create a "FrontController" like that in Cairgnorm, I won't use Cairgnorm because I don't have the time to learn this method right now. in any case, I want to spend my events to the FrontController and have that runs the appropriate method. All the examples I've seen use methods in the FrontController class. This will quickly become a mess, and I would break the code into separate logical categories.

    So my question is, how do you instantiate one method from another class?

    FrontClass.as
    public class FrontClass
    {
    addEventListener ("listenFor", this)
    }

    DoThis.as
    public class doubts
    {
    public void doubts (event): void {}
    }

    Thank you!!

    Hi I suggest, to have the FrontClass access to the instance of the class of doubts.

    See code below:

    public class FrontClass

    This var: doubts;
    {

    function FrontClass() {}
    this.addEventListener ("listenFor", doThis.doThis)
    }
    }

  • Passing variables between classes

    I think I'm doing this more difficult than it really is. I would like to pass a variable of a class to another, once a file has been loaded. Currently I have a ListLoader that querys a PHP/mySQL which returns the XML of the class. I would like to create another class that processes this XML but I don't know how he pass only after it is loaded. It's getter/setter methods, or am I missing something really simple (or something else entirely)?

    Here are the two classes, with that I fight.

    Because the ListLoader makes the loading and the panels there appear, the panels need to know when the XML is available. If the panels accessed the magazine to the list, they either need to keep control if their XML is loaded, or subscribe to the magazine as a listener. It is better for the charger inform services' (the signs) when to use the XML.

    Better yet, if signs are essentially "views", take the treatment on the XML panels and give him the charger, then pass the XML transformed like a string or an object, or whether you need. In this way, the charger is the 'supply' and not the display panel, and the two don't get merged.

    The next step is to put in another class - essentially a data model that stores everything that has need of a Panel, so you might have different versions of panels, all you have access to the same data model. This class would then become the "model", and the Panel becomes the "viewer". (do a search for 'model view controller' - it's a basic OOP structure that goes a long way to help you think about OBJECT oriented programming, even if you do do not match exactly).

  • Better way to access a class in reading/writing of several other classes?

    I need run to be retained on a class that gets read and written by the other classes. They share no common ancestor. The reads/writes will be synchronous, so there is no race condition to worry. My idea is to have just the class of all classes that need to access private data and make a 'transfer' between classes, e.g. bundling and unbundling in the classes that need it. This seems very messy. Any ideas?

    I use a data value reference in this situation.  You do just a digital recorder that contains your shared class, and then pass this DVR in all your other items to their initialization.  Given that everyone who needs to change the data has a reference to the data, anyone can modify it within their private methods through a Structure of elements in Place.

Maybe you are looking for

  • Problems with Ubuntu on the Satellite M305D-S4831

    I tried to install Ubuntu and Kubuntu as a dual boot with Vista and no lets my wireless or Lan of the right function. They both say that they have restricted drivers in use, but they do not always work. Can anyone help? The rest of the forums are ove

  • C:/Windows/HPRMPoe.dll error at startup

    This error appears when I start my computer

  • PhotoSmart Premium C310: Premium C310 printer Error Message

    PhotoSmart Premium C310 New ink, etc. Printer error message: 0XC19A0041 -What does this mean for the future of this printer?  Is dead, or can it be restored? Help! Gail50

  • Inspiron 1520 Windows Vista refused to install

    It's my father's cell phone and he had a blue screen whenever he pressed the start button... then he tried to re - install windows using an Inspiron 1525 CD. It froze during the instillation and since when we start this message appears; "The computer

  • 0x80071A91

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! I need help with this error message Thank you You have problems with programs Error messages Recent changes to your computer What you have alrea