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.

Tags: Adobe Animate

Similar Questions

  • AS 3.0 - & 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

  • 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!

  • 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

  • I bought Halo 2 for Vista, but who like OS Windows XP Pro, just can't launch the startup.exe, I search the community, there is a rumor that it won't work even with the patch. Can someone help, please?

    I bought Halo 2 for Vista, but who like OS Windows XP Pro, just can't launch the startup.exe, I search the community, there is a rumor that it won't work even with the patch. Can someone help, please?

    Unfortunately, Halo 2 does support Windows Vista and more.  Windows XP is not supported.  There may be 3 party hacks that can make it work, but they are not taken in charge and potentially dangerous.

    Paul Smith - MVP for Windows desktop experience... I crawled off NNTP - for now. Detachment Aldershot, United Kingdom. On the internet at windowsresource.net and dasmirnov.net. Please post back to let us know what works and what does not. :-)

  • Need help configuration IOS IPsec to enable communication between the VPN client

    Hi, I need help with the configuration of IPsec VPN router 2811. I want to allow communication between VPN clients, is that possible? I know that ASA, you can do this by using the command "permit same-security-traffic intra-interface".

    The fact is that each Client IP communicator installed, but when they tried to call each other, he failed. I guess that's because the connectivity between them is not permitted because of the VPN connection.

    Thanks in advance...

    Hello

    Try this: -.

    local pool IP 192.168.1.1 ippool 192.168.1.5

    access-list 1 permit host 192.168.1.2< vpn="" ip="" addr="" of="" client="">

    access-list 1 permit host 192.168.1.3< vpn="" ip="" addr="" of="" client="">

    access-list 1 permit 10.10.10.0 0.0.0.255

    < lan="" behind="" the="">

    ISAKMP crypto client configuration group vpnclient

    key cisco123

    ACL 1< binding="" the="" acl="">

    !

    --------Done-------------

    If you do NAT on the router then you might want to exempt your VPN traffic to be NAt had

    Assuming that the NAT of your router is

    overload of IP nat inside source list 111 interface FastEthernet1/0

    !

    ! - The access list is used to specify which traffic

    ! - must be translated to the outside Internet.

    access-list 111 deny ip 10.10.10.0 0.0.0.255 192.168.1.0 0.0.0.255

    access-list 111 deny ip 192.168.1.0 0.0.0.255 192.168.1.0 0.0.0.255

    Above two statements are exempt from nat traffic.

    access-list 111 allow ip 10.10.10.0 0.0.0.255 any<, permits="">

    I would like to know if it worked for you.

    Concerning

    M

  • Differences between the version of BlackBerry Device Software and platform. Help, please...

    Hi guys!

    I'm really confused... Help, please!

    We have developed applications for our customers. We tested with our BB8700 and it works fine.

    We used JDE4.2 for development... and we think that it will work on v4.2 based handsets.

    But our customers wrote that it works on v3.7. Why? Is this possible?

    I looked at the information about my 8700 device and then noticed: v4.2.1.107 (platform v2.3.0.84)

    -What are the differences between the version of BlackBerry Device Software and platform?

    Possible customers spoke of version 3.7 of the platform?

    There is a list of the devices, where we can find the version of BlackBerry Device Software by BlackBerry device model?

    Or where we can find information about the models of devices that will support our application?

    Thanks in advance!

    AFAIK there is no version 3.7 platform.

    Customer talking about the OS version.

    So, if they have the device OS version 3.7 you must use JDE JDE 3.6, 3.7 or older.

    Or take updated device OS if the necessary software is available.

  • Lightroom 6 suddenly very slow.  All my changes drag on the screen at least + 10 seconds.  The screen seems frozen between each edition.  I use a macbook pro and all my programs are up to date.  Help, please

    Lightroom 6 suddenly very slow.  All my changes drag on the screen at least + 10 seconds.  The screen seems frozen between each edition.  I use a macbook pro and all my programs are up to date.  Help, please

    Hi janeslens,

    • Go to Lightroom > Preferences.
    • Also please go to preferences > Performance tab and uncheck the box "use graphics processor.
    • Restart Lightroom and see if it works.
    • Please make sure you also update of Lightroom to the latest version, which is 6.3 Lightroom

    Let me know if it helps.

    Kind regards

    Tanuj

  • New Win 7 computer cannot access the IP address of the network printer. Help, please.

    Greetings,

    -----------------------------------------------------------------------------------------------------------------------

    UPDATE: we have found the solution to this problem, we, and that I posted an explanation as well as two ways to solve the problem in my 2nd post on May 5, 2015. Scroll down to it for the solution. Unfortunately, Microsoft does not allow the OP to mark one of their own messages as 'the Answer' so this thread continues to be listed as "no answer" when he actually answered me.

    -----------------------------------------------------------------------------------------------------------------------

    The original message follows...

    We cannot sign a new Win 7 (64-bit) computer to a printer ethernet established in our local network of 'working '. We have reached the limit of our troubleshooting skills and expertise assistance.

    Our Local network
    ------------------------
    The printer is a Dell 5100cn workgroup laser that is connected via an ethernet cable to a 10/100 workgroup switch 5-port Cisco/Linksys. The switch is connected to the built-in cable Motorola modem / 4 port gigabit router / WiFi access point. There is no server between the printer and the network.

    Other computers on the network run also Win 7 and have no trouble seeing and using the printer. Some computers are connected via a gigabit ethernet cable to the router Motorola. Other computers connect wireless WiFi (once again, by the same Motorola device). All computers, including the new ones, are attributed to the same workgroup.

    The printer has a static IP address. It also has an integrated Web page accessible within the network via a browser to view the status of the printer. All previous computers can view the status of the printer Web page by entering its IP address in a browser.

    The new Win 7 computer
    --------------------------------
    At the Windows command prompt, we successfully ping the IP address of the printer and received a return signal. However, we are unable to connect to the IP address of the printer (and status Web page) with a browser. And we cannot find the printer when install us the printer driver. We have tried to turn off the Windows Firewall and it did not help.

    When we install the driver, move us as a 'local' printer and create a new "Standard TCP/IP Port" for her. We enter the static IP address of the printer and name the port. Define us the Protocol to "LPR", enter the name of the queue ("lp") and activate SNMP State with name of the 'public' community and the index "1". These settings have worked very well with our previous computers.

    When the time comes to 'choose printer', we select 'have disk... '. ' and use the Dell 64-bit for this printer driver. But it does not work and do not print a test page. We even tried to install the printer as a 'network' printer driver, but it does not, either. In addition, the 'local' method always seemed to work best in the past.

    The new computer has no harm to see other computers and devices on the network. For example, there is a NAS connected to the same switch Cisco/Linksys like the printer and the computer can access the NAS via its static IP address. The new computer can also access the internet. He can't use the IP address of the printer. We even tried to change the address IP of the printer, but that did not help either.

    Despite the fact that the work - the network troubleshooter Windows command prompt ping indicates that the printer is not responding. What do we lack? Help, please.

    Greetings,

    I hope that this will be our last post on this subject. We have discovered the source of the problem and can offer two 'fixed' in case someone else runs into the same situation.

    With the help of MSConfig and a process of elimination, we have disabled non-Microsoft services that were running on the computer until we discovered that "Qualcomm Atheros Killer Service V2" was the source of the problem.

    Explanation

    ----------------

    Our new Win 7 computer contains a communication module ethernet/WiFi/Bluetooth e2200 Qualcomm Atheros. The manufacturer provides a '' Killer Network Manager '' for this system. Its purpose is to monitor and control the flow of data over a network connection in order to optimize for. For example, the user can choose to give the program A high priority and program-B low priority. This ensures that the program-A is less lag in the network traffic.

    The primary market for this function, so far, has been the online game (where the name of 'Killer'). It allows players to channel the bulk of the bandwidth available to their game and away from other programs and services that are running at the same time. A response faster online gives the player the advantage it needs to get "kill him" before someone else.

    This system of control of bandwidth has interfered with data packets of return of our network, clearing communication between our computer and our printer printer.

    Difficulty 1

    --------------

    The simplest solution for us was to disable 'Qualcomm Atheros bandwidth control' for the ethernet NIC that has been accomplished by going to: Windows Control Panel > network and Internet > Network and Sharing Center > change the settings of the card (in the sidebar). Then we clicked on our connection to the LAN (our NETWORK ethernet card) and select the 'Properties' command Finally, on the Networking tab, we have disabled 'Qualcomm Atheros control bandwidth' and clicked 'OK' button to close.

    All that was needed after that was a quick restart and we were able to access our printer even with the killer Network Manager and functioning of Qualcomm Atheros Killer Service V2.

    Either way, we left the control function of bandwidth enabled for wireless (our) network connection because we do not plan on using this network printer when the computer is untethered to ethernet.

    Difficulty 2

    --------------

    If you don't want the killer running Network Manager on your computer, you may be tempted to uninstall. Do not! Uninstall will also uninstall the drivers needed for your ethernet, WiFi and possibly your Bluetooth as well. We heard that some users have communicated with Qualcomm and were able to coax, on their part, the necessary drivers comm without luggage "Killer". But you don't need to do it, either.

    All you need to do is: (1) remove the 'Killer Network Manager' of the '"start up" folder of the start menu of Windows (under "programs") and (2) using MSConfig, uncheck "Qualcomm Atheros Killer Service V2" under the ' Services ' section. Then reboot and you're good to go. The killer Network Manager and his service will not work.

    Moreover, the reason for which we did not chose this method, ourselves, is because we see one deserves that available Killer Network Manager so that we can block network traffic to select programs. Solution 1 converts this easy thing because the Ethernet bandwidth control can be quickly activated again if she is ever desired. And we're leaving it enabled for our WiFi.

    Best regards, David-EH

  • communication between machines in vmware.

    Hello.

    I have two machines in my vmware.

    I want to have a communicate with each other.

    I have set up a virtual network in vmware-NAT.

    Each of them has an ip address:

    Server Windows 2012 - 50.50.10.200

    Windows 7 - 50.50.10.5

    I'm doing a ping of windows 7 for server 2012 and I am not getting a response.

    So I don't see that they are communicating with each other.

    I'd appreciate your help.

    Mehdi neo

    If your two virtual machines to connect to the same virtual network NAT, they should have a communication between them, for you case "cannot get a response", please check if you have disabled the firewall in your server 2012

  • Bookmarks are missing from the list tab so much my favorite and I do not know if this was caused by the plugin or due to lack of space in my internal HD. Help, please?

    Dear community, I promise that I will try to be as concise as possible. I am really desperate for help! I read absolutely everything about missing bookmarks, but as you can see my problem also concerns the sliders and Google are different on the screen.

    It all started that day that I was running short on storage in my boarding school HD all of a sudden my computer showed that I had 0 KB available, and I just deleted some big mov files and restarted the computer. After the reboot, I opened FF and noticed that my favorites were missing and so has my reading list - my reading list is stored using the ReadItLater plugin (https://addons.mozilla.org/en-US/firefox/addon/read-it-later/). I tried to google solutions for my problem and realized that something was strange the way the results have been posted.

    So, I made some screenshots because it's really hard to explain what happens in writing, so please take a look:

    1. when I first open my FF, if I click on ReadItLater, I get this error message (code 0 x 80570016): [[click here | http://www.flickr.com/photos/81007892@N07/7423869970/]]

    2. then if I click any link on the page and go back to check my ReadItLater list, I can open it without receiving an error message, but always WITHOUT READING LIST is displayed. Image: [[click here | http://flic.kr/p/cj2gPm]]

    3. now take a look at how Google is the display of the results on FF! The text appears in black/green when it is really supposed to be displayed in blue/green/black! The cursor is also messed up: when I try to click on one of the links with the arrow, it turns into a cursor type instead of the usual hand or by clicking on the slider! Please see the image: [[click here | http://www.flickr.com/photos/81007892@N07/7423869468/]]

    4. here is a screenshot of the same search Google but this time made the Safari. Compare it with the previous image: [[click here | http://www.flickr.com/photos/81007892@N07/7423869252/]]

    Any help will be much appreciated. I tried to reinstall FF again once already and I also deleted and reinstalled FF but I never deleted personal profile which is located in the library folder information. In addition, tried to back up and replace the profile folder but my computer does not allow me. I received a message saying that it was not possible to copy the file places.sqlite - wal. I did a search on this subject and I can say that I never had a double profile. Help, please? I'm desperate and I can't lose my playlist of my favorites!

    Thank you, community of Firefox!

    Hello

    Please see this.

  • Skype opens then closes! Help please...

    Skype opens then closes! Help please...

    When I open Skype a white window opens and then it closes. On the small icons to the right to open also to the Skype logo in offline mode. (There is an arrow that goes upward, there on the taskbar), some assistance please.

    Have you uninstalled DroidCam and other applications of virtual screenshot?

    See also this:

    http://community.Skype.com/T5/Windows-desktop-client/Skype-closes-on-startup/m-p/3478525#M290321

  • I get a message: to use the 'java' command line tool, you must install a JDK.  I tried 10 times to install without success.  Help, please.

    I get a message: to use the 'java' command line tool, you must install a JDK.  I tried 10 times to install without success.  Help, please.

    You probably have some of the older than the needs/desires software legacy Java installed.

    Please see these sons of community message:

    After the installation of El Capitan, I get the message: to use the 'java' command line tool, you must install a JDK

    Just found this last Java does not work with El Capitan

    This is the Apple link to the legacy version of Java 6.

    Download Java for OS X 2015-001

    First of all, I would like to try to identify what application generated the next message and update (delete) this request as the case may be. If you need to run Java then, as the Apple Support page says it's certainly preferable that your installation of Java entirely up-to-date with the Oracle's Java course. If you can get without Java, you should install it not - like the Flash, it should not be installed unless you have no choice.

  • LOST ON MY IDEAPAD Y560P BIOS PASSWORD... Help, please

    HELLO GUYS, I AM DESPERATELY LOOKING FOR HELP, I GAVE A LAPTOP REACENTLY AND JUST DISCOVERED BIOS IS LOCK, I TRIED TO CALL SUPORT BUT THEY ASK FOR PROOF OF PURCHASE WHICH I DID NOT, BECAUSE IT WAS GIVEN, PLEASE IF ANY BODY CAN HELP ME ON HOW TO RESET I TRULLY ENJOY THIS GUY... Help, please

    Welcome to the community.

    Sorry, you have problems.

    From your post, 'BIOS IS LOCKED', it seems that there is a supervisor password set. There is no discount to zero/workaround for a lost password supervidsor.

    The best advice is to talk with the person who gave you the laptop to try to obtain the password. In addition, the only authorized here discussion about the subject is contained in the manual of your equipment:
    http://download.Lenovo.com/userfiles/Userguide/en/user%27s%20guides%20and%20Manuals/Y560/Lenovo%20Id...
    Please see the section on page 24 of the manual.

    Kind regards.

  • Plotting bar help please

    Hello

    I have spent some time on it and could really use some help please. I have looked at the plot in real time in the help, searched the forum, but the examples isn't enough similarity for me change.

    The attached vi is a graph of the waveform (with bars) which I use to show a single value read from a text file. The value in the text file will update once every half hour (from a data logger), for a total of 10 hours (20 values)

    I would like to see each point on the graph from left to right with a spacing between the two. The value in the text file will pass (never down) so the plot resulting bars resemble a staircase (but with heights different step). The process will continue with a small break between two periods of update files and previous data points (bars) must therefore be kept (and available by zip, so I can code pretty easily).

    Could someone show me how this could be achieved?

    Thank you in anticipation

    Ray

    Hi Ray,

    Here are a few examples.

    The first - mod bar graph - uses a node back feeding to see if an item has been added to the data file.

    You can consider using a graphic as in the second example - graphic bar. With a graphic, you can change the number of data points to resize the waveform table. In this example, a shift register is used to allow only insert new values into the table.

    Steve

Maybe you are looking for