Problem accessing nested MovieClips

Hi I'm trying to add an event Listener to a button that is nested inside a movieclip, and that movieclip is nested inside another movieclip, but I get a null object reference error where I add the event listener:
public function OptionsClass(model:GameModel, stage:Object) {
                              // constructor code
                              _gameModel = model;
                              _stage = stage;
                              _optionsClip = new Options();
                              _optionsClip.gotoAndStop(1);
                              addChild(_optionsClip);
                              _optionsClip.optionsMC.controlsBtn.addEventListener(MouseEvent.MOUSE_DOWN, onControlsBtnDown); -->ERROR
                              _optionsClip.optionsMC.backBtn.addEventListener(MouseEvent.MOUSE_DOWN, onBackBtnDown);
all the instances are named correctly on the movieclips so I don't know what the problem is. If anyone knows what I'm doing wrong please let me know, thank you.

NEVERMIND I FIXED IT, I HAD THE LABELS WRONG, SORRY

Similar Messages

  • Nested MovieClips

    I have a problem that I think is a simple one but I cannot seem to figure it out, and it has been 2 days of fighting wiht it so I am here to plea for help from the collective experts. Here is the issue.
    I have created a movieClip which is just a rectangle shape that has an interior timeline which object tweens from a 2x200 pixel to a 200x200 pixel shape.
    This movieClip has an instance name of menu_2.
    After the tween happens inside menu_2, on the stop(); frame I have placed another movieClip with an instance name of mi_1. This clip is 100 x 35 pixels and site floating inside the menu_2 MovieClip. Inside this movieClip there is a timeline where there are a "the_start" and a "the_end" label on either end of the timeline each with stop(); comands and some graphics which change opacity.
    What I cannot seem to get to happen is to activate the timeline inside the mi_1 MovieClip. What I would like to happen is that when the user mouses over the mi_1 movieClip, it triggers a number of events, along with triggering playing the timeline inside of mi_2.
    Here is the code I have tried on the main (scene 1) timeline. None of which have worked.
    menu_2.mi_1.onRollOver = function() {
         menu_2.mi_1.gotoAndStop("the_end");
    mi_1.onRollOver = function() {
         mi_1.gotoAndStop("the_end");
    menu_2.onRollOver = function() {
         mi_1.gotoAndStop("the_end");
    menu_2.onRollOver = function() {
    this. mi_1.play();
    Here is the code I have tried inside the menu_2 MovieClip on the same frame as the mi_1 has been placed;
    this.onRollOver = function() {
         mi_1.gotoAndStop("the_end");
    mi_1.onRollOver = function() {
         gotoAndStop("the_end");
    this.onRollOver = function() {
         this.gotoAndStop("the_end");
    Nothing seems to be working.
    I'll send anyone the FLA willing to help...
    Help!
    Forrest

    That's what I thought too Ned. All the reseach I did, tells me that is how you access a nested movieClip in another MovieClip.
    Your visible code works as it should, but I still cannot get the nested MovieClip to be affected by a call to action on the main timeline.
    menu_2.mi_1.onRollOver = function() {
         menu_2.mi_1.gotoAndStop("the_end");
    Did not do anything. I would have just used a button with roll over effects, but a button also seems to be masked inside the menu_2 mc.
    aarrrg.

  • Is there any way to save an image from a nested movieclip as a .png using PNGEncoder

    Hello all,
    I am new to AIR and AS3 and I am developing a small AIR desktop application in Flash CS5 that saves a user generated image locally to their computer. 
    The image is generated from a series of user choices based on .png files that are loaded dynamically into a series of nested movieclips via XML.  The final image is constructed by a series of these "user choices".
    Sourcing alot of code examples from here and there, I have managed to build a "working" example of the application.  I am able to "draw" the parent movieclip to which all the other dynamic movieclips reside and can then encode it using PNGEncoder.  The problem is that the images loaded dynamically into the nested movieclips show as blank in the final .png generated by the user.
    Is there a way to "draw" and encode these nested movieclips or do I need to find another way?  I can provide my clumsy code if required but would like to know if this concept is viable before moving any further.....
    Thanks in advance....

    Thanks for the files.......
    Yeah I'm doing it in Flash but importing the images via an xml document.  The problem isn't in being able to view the eyes (based on the selection of the user) its when I go to save the resulting image as a .png.  When I open up the saved .png the eyes are blank even though they are visible in the swf
    Even when the user clicks on the option to copy the image to the clipboard, it works as intended.
    My only guess is there is an issue with the way my xml is loading (but this appears to work fine) or when the file is converted and saved.....
    As I said I'm still learning but surely there must be a simple answer to this....
    I have included the xml code I am using and also the save code to see if anyone spots an issue..... (I hope I copied it all)
    // XML
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    var xmlRequest:URLRequest = new URLRequest("imageData.xml");
    var xmlLoader:URLLoader = new URLLoader(xmlRequest);
    var imgData:XML;
    var imageLoader:Loader;
    var imgNum:Number = 0;
    var numberOfChildren:Number;
    function packaged():void
    rawImage = imgData.image[imgNum].imgURL;
    numberOfChildren = imgData.*.length();
    imageLoader = new Loader  ;
    imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedImage);
    imageLoader.load(new URLRequest(rawImage));
    faceBG_mc.Eyes.addChild(imageLoader);
    function loadedImage(event:Event):void
    imageLoader.x = -186;
    imageLoader.y = -94;
    imageLoader.width = 373;
    imageLoader.height = 186;
    //  Clipboard
    btn_Copy.addEventListener(MouseEvent.CLICK, onCopyClick);
    function onCopyClick(event:MouseEvent):void
    var bd:BitmapData = renderBitmapData();
    Clipboard.generalClipboard.setData(ClipboardFormats.BITMAP_FORMAT, bd);
    function renderBitmapData():BitmapData
    var bd:BitmapData = new BitmapData(faceBG_mc.width,faceBG_mc.height);
    bd.draw(faceBG_mc);
    return bd;
    // Save faceBG_mc as .png 
    var fileRef:FileReference = new FileReference();
    var myBitmapData:BitmapData = new BitmapData (faceBG_mc.width,faceBG_mc.height, true, 0);
    myBitmapData.draw(faceBG_mc);
    var myPNG:ByteArray = PNGEncoder.encode(myBitmapData);
    function onSaveClickPNG(e:Event)
    fileRef.save(myPNG, "myPNG.png");
    So my problem is....
    The final image is copied to the clipboard with the eyes visible - yes
    The eyes appear in the image in the swf as intended - yes
    When the image is saved as a .png and is meant to include the eyes, they are blank (see picture above)
    I hope this helps.....
    Thanks in advance

  • How to stop and resume the animations of nested movieclips

    Hi
    I have many nested movieclips  in different positions of the main timeline.
    I have 2 buttons, play_btn and pause_btn.
    I'd like when the user click pause_btn, the animations on the main timeline and in nested movieclips stop.
    Whe he click play_btn the animations resume in both the main timeline and nested movieclips.
    I have created array of nested movieclips on the main timeline.
    var arr:Array = new Array(mc1, mc2, mc3, mc4, mc5);
    play_btn.addEventListener(MouseEvent.CLICK, on_play_btn);
    pause_btn.addEventListener(MouseEvent.CLICK, on_pause_btn);
    function on_play_btn(e:MouseEvent):void
         gotoAndPlay(currentFrame);
         for(var i:Number = 0; i < arr.length; i++)
             if(arr[i] != null)
                 arr[i].play();
    function on_pause_btn(e:MouseEvent):void
         gotoAndStop(currentFrame);
         for(var k:Number = 0; k < arr.length; k++)
             if(arr[k] != null)
                 arr[k].stop();
    but it only stops the animations on the main timeline and dosen't stop the animations in the nested movieclips.
    Help me Please.

    I'm having the same issue.I have a main timeline, which has nested movieclips with there own timelines and motion tweens. Using the new motion tween, and not the classic tween, which may or may not be the problem.
    Was having a similar issue with stopping the timeline, the main timeline would stop, but the nested movieclips would keep going. Found this blog post that helped.
    http://blog.nobien.net/2009/02/05/as3-stopping-all-timeline-animations/
    Used the code below to stop everything by passing the stage as the displayObject. Worked great, but now i'm having the reverse issue. When I resume play, the nested movieclip timeline stays exactly where I stopped it, and the main timeline resumes play. If there are a 100 frames in the nested movieclip, once it reaches the 101st frame, the main timeline kicks in again.
    function stopAllChildMovieClips(displayObject:DisplayObjectContainer):void{
            var numChildren:int = displayObject.numChildren;
            for (var i:int = 0; i < numChildren; i++) {
                var child:DisplayObject = displayObject.getChildAt(i);
                if (child is DisplayObjectContainer) {
                    if (child is MovieClip) {
                        MovieClip(child).stop();
                        stopAllChildMovieClips(DisplayObjectContainer(child));

  • Accessing nested child in model to populate datafield in datagrid.

    I am using Rails + Flex and I have problems to access nested
    xml in a datagrid.datafield.
    I reproduce this in a simple mxml sample:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="954">
    <mx:Model id="md">
    <root>
    <e1>el1</e1>
    <e2>el2</e2>
    <child>
    <c1>c1</c1>
    <c2>c2</c2>
    </child>
    <e3>el3</e3>
    </root>
    </mx:Model>
    <mx:DataGrid id="myGrid"
    dataProvider="{md}" >
    <mx:columns>
    <mx:DataGridColumn dataField="e1"/>
    <mx:DataGridColumn dataField="e2"/>
    <mx:DataGridColumn dataField="child"/>
    <mx:DataGridColumn dataField="child.c1"/>
    <mx:DataGridColumn dataField="e3"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>
    Basically, at runtime the content of 3rd column is object
    (alright) and the 4th column is empty whereas it should be "c1".
    Am I doing something obviously wrong ?
    Thanks for any help.
    Romain.

    http://www.adobe.com/devnet/flex/articles/e4x_03.html
    http://www.adobe.com/devnet/flex/articles/e4x_04.html
    you can use the labelfunction

  • Accessing nested UIComponents

    The aim of the script is to be able to access component's
    chldren, and their children, and their children, etc... by their
    index.
    I've tried the following:
    // script
    public function deployNesting():void {
    var container:Canvas= new Canvas();
    var chldA:Canvas = new Canvas();
    var chldB:Canvas = new Canvas();
    var chldC:Canvas = new Canvas();
    this.addChild(this.container);
    this.container.addChild(chldA);
    this.container.addChild(chldB);
    this.container.addChild(chldC);
    return;
    public function accessNesting():void {
    trace(this.childAt(0).childAt(0))
    // error 1119*
    trace(this.childAt(0).numChildren)
    // error 1119*
    return;
    *1119 : Access of possibly undefined property numChildren
    through a reference with static type
    flash.display:DisplayObject.
    I'm aware that such nesting is not usually a best practice,
    but in some cases it is required, and I would appreciate an advice
    on this issue.
    a.neko

    Well... It's time to assume the therapeutical values of this
    forum in my particular case : ) One more time, just after recurring
    to all posiible ways to solve it, and afterwards posting a topic
    here, I change my approach and find the solution...
    In this case it is required to cast the return of all the
    getChildAt() in the nesting structure, except the last one.
    You can access a nested child to add a new child to it's
    display list as follows:
    Canvas(this.getChildAt(0)).addChild(chldC);
    Accessing a deeply nested child's name property looks as
    follows:
    Canvas((Canvas(this.getChildAt(0))).getChildAt(0)).getChildAt(0).name;
    etc...
    Somewhat complicated, but solves the problem of accessing
    nested children when, for instance, the variables used to create
    them are gone, or to freely iterate through nested display lists...
    (Verified with Flex 2.0 Builder mx.* components, but I
    suppose it works also for flash.display.* objects.)
    a.neko

  • Problem accessing function within my Document Class

    Hi there,
    I have a Document Class which dynamically adds a MovieClip to
    my FLA. The MovieClip is in the FLA library and has "Export for
    ActionScript" setup for it and this is how I'm accessing the
    MovieClip from my Document Class.
    The problem is that when the MovieClip is finished (it has a
    timeline animation and a stop() method applied to the last frame of
    the animation) I want it to call a function that is placed within
    my Document Class, but simply calling the function (e.g.
    displayEnterButton();) is displaying an error of....
    1180: Call to a possibly undefined method
    displayEnterButton.
    Can anyone help here, I'm sure it's a simple issue to
    resolve.
    Many thanks!
    Kind regards,
    M.

    Hi,
    I've managed a work around to this.
    Basically, in my Document Class after the code that adds the
    MovieClip to the Display List, I then setup a Timer that called a
    function every 100 milliseconds. This function would then check the
    current frame of the loaded MovieClip. If the current frame of the
    MovieClip was equal to the last frame of the MovieClip then I would
    know the animation had finished and would call the next function I
    needed.
    I've pasted the code below in case anyone was interested....

  • Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default

    in use:
    vRO 5.1
    eclipse 3.7.2
    vRo plug-sdk 5.1
    steps:
    1.create a plug-in project from samples(choose solar system)
    2.find the dar package and upload it by vRo configuration
    3.vRo configuration said upload successfully,but the solar system configuration is not properly configued..
    problem:
    Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default
    How to solve it??
    Thanks so much!!

    There was problem from crm side...its working now..

  • Having problems accessing any apps on my iCloud. Set up and signed in successfully but then when I click on an app it just says there's a problem but doesn't say how to fix it. Please help, am very new to this!

    Hi
    I am very new to updating my iPod touch and this is the first time I've used the iCloud. However, I am having problems accessing any apps on my iCloud such as photos, reminders etc. I've set it up on my iPod touch successfully and I can sign in on my PC. However, when I try to access any of the apps it says there was a problem. It doesn't tell me how to fix it or what the problem is.
    Is anyone able to help?

    It is working now. I no longer get the message about the item not being available in the US and I can access the store.

  • Problems accessing Music Files in Slideshow module in LR 2.6 and Windows 7 64 bit

         Just got new computer 64 bit Windows 7.  Installed LR 2.6 and am having problem with slideshow and music.  Never had this problem before with my XP computer.  When I open up slideshow module and go to Playback window and check soundtrack and try to choose a music folder, I have a new problem.  It opens up "Browse for Files & Folders" dialog box as usual, but it only lets me browse on my desktop or my User name on the C drive.  My music is in my F drive where my data is stored.  I've never had a problem accessing my music in my F drive in my XP computer, but this setup limits where I can browse to.  Interesetingly, this works OK in LR 3 beta on this WIndows 7 PC where it opens up a dialog box "Choose a music file to play" which gives me access to all my drives.  In summary, I can't access music files stored on a drive other than my C drive using LR 2.6 on a Windows 7 64 bit computer.
         I have attached a screen shot to compare the new Windows 7 Browse for Files & Folders dialog box to that in my XP computer.
         Would appreciate any suggestions.
    Thanks,
    Matthew Kraus

    Thanks for the reply.  I went through the process you suggested to change Ownership  & grant permission to access files.  When I get to the owner tab in Advanced Security Settings....I am already the current owner of this folder.
    What do I do now?
    Thanks,
    Matthew Kraus

  • Problems accessing Time Capsule on windows Vista

    I have an iMac running Leopard and a laptop running Vista Home Edition. I'm having some problems accessing Time Capsule from the Vista machine. everytime I click to access the drive, a message appears in the menu bar of the window that says (not responding). I've tried leaving it. I've even changed my entire wireless network to bypass the original g router (belkin) to use TC, so I now have TC as my router, Belkin just setup as a wired broadband modem but I still get the same problem. The mac seems fine, although I have had quite a few issues with drop outs.
    both machines have the latest version of Airport Utility and Bonjour.
    The laptop is a recent purchase to replace a dead XP machine, this worked fine and I managed to get stuff backed up just before it died, thankgod.
    Any help appreciated.

    No problem seeing Time Capsule with iMac, Dell desktop XP Home, Dell notebook XP Pro, and Fusion with XP Pro. All installed according to the installation guide. Installed AirPort Utility on all machines and updated firmware to 7.3.1. To see the other machines, make sure file sharing is on. Firewall on the PCs may need to be turned off. The printer plugged into the USB port also worked with all the XP systems and the iMac with a few missing features on iMac (I am assuming different driver issues). BTW, logging onto the created network and accessing the Time Capsule HD are separate. If you've entered different passwords for the HD and wireless networking when setting up Time Capsule initially (which I did through the iMac first), you'll need to enter them separately with the XP machines. You could also try resetting Time Capsule. Seems to work for others.

  • Problem accessing adobe camera raw in Bridge for CS6

    I have a problem accessing adobe camera raw in Bridge (CS6) directly, I get the message: "Bridge's parent application is not active; Bridge requires that qualifying product has been launched at least once to enable in Bridge or Accessing Photoshop directly, I get the message: "Bridge's parent application is not active; Bridge requires that qualifying product has been launched at least once to enable this feature."  My software is registered with Adobe. Any solutions?feature."  My software is registered with Adobe. Any solutions?

    Creative Suite Cleaner Tool laufen lassen, neu installieren. Und was auch immer für ein dämliches Update den Schaden verursacht haben mag einfach nicht aufspielen, wenn nicht unbedingt nötig...
    Mylenium

  • Problem accessing iTunes. Getting error message "The iTunes Library Extras.itdb file is on a locked disk"?

    Problem accessing iTunes. Getting error message "The iTunes Library Extras.itdb file is on a locked disk"

    Close iTunes, delete iTunes Library Extras.itdb from your iTunes folder, start iTunes. iTunes should rebuild the file automatically.
    tt2

  • Exchange setup error: "There was a problem accessing the registry on this computer"

     Hi,
    i am trying to install Exchange 2007 SP1 in a Windows 2003 Server standard 32 bits version.
    During the "Readiness checks" i received the next error in "Hub transport role prerequisites":
    Error:
    There was a problem accessing the registry on this computer. This may happen if the Remote Registry service is not running; it may also indicate a network problem.
    Remote Registry service is running. I've searched for the error in google and in some topics appears that the error is due to the "Client for Microsoft Networks" and "File and Printer Sharing" is not installed in the LAN properties. The server has 2 network cards and in both of them is checked. One of the connections is disabled.
    I dont know what more to do, any help will be appreciated.
    Thanks

    No, firewall is disabled.
    Setup Logs says:
    10:50:04.890: Starting Collecting Data phase.
    10:50:04.921: No mapping between account names and security IDs was done
    10:50:04.984: Error (Unexpected error [0x674CBB7E] while executing command '[Microsoft.Win32.RegistryKey]:penRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, [System.Net.Dns]::GetHostEntry([System.Net.Dns]::GetHostName()).HostName)'.) trying to process object [Microsoft.Win32.RegistryKey]:penRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, [System.Net.Dns]::GetHostEntry([System.Net.Dns]::GetHostName()).HostName), skipping object.
    10:50:06.093: Completed Collecting Data phase.
    10:50:06.125: Error (Rule name 'PreReq_fPassiveUninstallNoCMSPresentKey' referenced by rule 'PreReq_fPassiveUninstallNoCMSPresent' in input file is not defined) in format of rules in configuration file.
    10:50:06.171: Starting Postprocessing Rules phase.
    10:50:06.187: Completed Postprocessing Rules phase.
    Thanks for your help!

  • Problem accessing R/3 with SSO ticket from the EP6.0

    Hi all,
    I have seen this thread: Problem accessing R/3 with SSO ticket from the EP6.0
    I know that it is possible to read SSO ticket from the Cookie in WebDynpro application.
    Now we are at the first step, we don't know how to read SSO ticket from the Cookie in WebDynpro application with java code.
    So anyone can help us?

    Hi,
    This has been discussed in a previous forum.Check this link.A code snippet is also there to read a cookie in webdynpro with this question
    How to implement SSO between Portal, Webdypro and ABAP system?
    I am not able to send the link exactly.
    Regards,
    Sowjanya.
    Message was edited by: Sowjanya Chintala

Maybe you are looking for

  • A little question about inheritance

    Can someone explain this to me? I have been reading about inheritance in Java. As I understand it when you extend a class, every method gets "copied" to the subclass. If this is so, how come this doesn't work? class inherit {     int number;     publ

  • Mass Release of Requests

    Dear Experts, Is there any way to release requests on a mass basis? I have a list of requests(100) which have to be released on a mass basis and then transported. Is there any way to do it? Thanks and Regards, Ravi Bhatnagar

  • Order Confirmation Emails -

    Hi All. I have an orderconfirmation page that sends out an email to both the customer and myself. The page uses an include that sets the details for CDONTS and also the body of the email (see code below) All works fine, but now i want to send two ver

  • Installation error master suite cs6

    Exit Code: 6 Please see specific errors and warnings below for troubleshooting. For example,  ERROR: DW050 ... WARNING: DF012, DF029 ... -------------------------------------- Summary -------------------------------------- - 0 fatal error(s), 2 error

  • Item pop up in PO

    Hello All, is there a possibillity to create a text for an item which will appear/ pop up automatically if we create a PO for them? thanks best regards