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.

Similar Messages

  • 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));

  • Events and nested movieclips issue

    Hi,
    I am having the following issue with this navigation I am building. I am trying to build a 3 tear drop down navigation, where each buttons sub menu is placed inside that button. My buttons are actually just movieclips, so I have nested movieclips structured something like this:
    Button_1
        -> Button_1_1
        -> Button_1_2
               --> Button_1_2_1
               --> Button_1_2_2
        -> Button_1_3
    Button_2
    Button_3
    Each one of the buttons has their own class with it's event listenerens inside it. What happens now, is that when I click for example Button_1_2_1, I get it's event, but also, the event for Button_1_2 and Button_1. Initially, I fixed this, by attaching the events to a hitArea inside that movieclip, but now I am running into other issues and was wondering if there was a way to turn this off, so if movieclip for Button_1_2_1 is clicked, I only get the event for that one, not it's parents?
    Thanks a lot for any help!

    you're welcome.
    p.s.  in the future, please mark helpful/correct answers.

  • Stop all nested movieclips

    Hello,
    I made a series of nested movieclips, and to stop all motion i wrote this code:
    on (press) {
    MCinMCinMC.stop();
    MCinMCinMC.MCinMC.stop();
    MCinMCinMC.MCinMC.MC.stop();
    MCinMCinMC.MCinMC1.stop();
    MCinMCinMC.MCinMC1.MC.stop();
    MCinMCinMC.MCinMC2.stop();
    MCinMCinMC.MCinMC2.MC.stop();
    MCinMCinMC1.stop();
    MCinMCinMC1.MCinMC.stop();
    MCinMCinMC1.MCinMC.MC.stop();
    MCinMCinMC1.MCinMC1.stop();
    MCinMCinMC1.MCinMC1.MC.stop();
    MCinMCinMC1.MCinMC2.stop();
    MCinMCinMC1.MCinMC2.MC.stop();
    MCinMCinMC2.stop();
    MCinMCinMC2.MCinMC.stop();
    MCinMCinMC2.MCinMC.MC.stop();
    MCinMCinMC2.MCinMC1.stop();
    MCinMCinMC2.MCinMC1.MC.stop();
    MCinMCinMC2.MCinMC2.stop();
    MCinMCinMC2.MCinMC2.MC.stop();
    This code works fine, but can somebody explain how to write this in a more compact way?

    Thank you very much!  This will save me an awful lot of typing.
    The thing with me and actionscript is, when i read it, i understand what it does, but i have a lot of trouble writing it.

  • AS3 Playback control of nested movieclips

    Hey all,
    I'm trying to figure out how to control a movieclip symbol from the timeline.
    I've created a Main Timeline with one symbol per frame, a labels layer and an action layer.
    Each frame has its own label, and each action keyframe has a listener attached to the current symbol like so:
    symb = title_mc;
    symb.cacheAsBitmap = true;
    symb.mask = f_mask;
    symb.focusRect = false;
    stage.focus = symb;
    symb.addEventListener(KeyboardEvent.KEY_DOWN, mc_pager);
    I need the following structure:
    From Main timeline Frame
    Identify symbol instance (labeled as <name>_mc)
    Inside symbol timeline, play from first frame (labeled '0') until next labeled frame ('1' and so on)
    stop and wait for next pg_down to start playing from next labeled frame to the following (i.e. '1'-'2'), or pg_up to start playing from the previous labeled frame (i.e. '0' - '1')
    on last frame (labeled 'final') exit symbol focus and return keyboard control to main timeline to allow pg_down and pg_up to move to the next / previous frame. on pg_up on symbol.currentFrame == 0, do same.
    This is the code I'm currently stuck with:
    import flash.events.Event;
    import flash.display.MovieClip;
    import flash.events.KeyboardEvent;
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    stop();
    f_mask.cacheAsBitmap = true;
    var symb:MovieClip;
    symb = MovieClip(root); //assign symbol I want to be controlled by pg_up/pg_down
    symb.focusRect = false;
    symb.addEventListener(KeyboardEvent.KEY_DOWN, mc_pager);  //add keyboard event listener
    stage.focus = symb; //focus on current symbol
    function mc_pager(e:KeyboardEvent):void{
        var myKey = e.keyCode;
        if (myKey == Keyboard.PAGE_DOWN){
            do{
                symb.play(); // it plays, then checks if the lbl is null or final, then quits
                trace("current: " + symb.currentFrameLabel);
            } while (symb.currentFrameLabel == null && symb.currentFrameLabel != 'final');
            symb.stop();
            symb.removeEventListener(KeyboardEvent.KEY_DOWN, mc_pager);
            stage.focus=MovieClip(root); //return focus to main timeline (in the next keyframes, the focus is on the nested _mc
        if (myKey == Keyboard.PAGE_UP){
            do{
                symb.prevFrame();
            } while (symb.currentFrameLabel == null && symb.currentFrameLabel != '0');
            symb.stop();
            symb.removeEventListener(KeyboardEvent.KEY_DOWN, mc_pager);
            stage.focus=MovieClip(root);
    So far, I've tried several different things (including multiple eventhandlers) to no avail. This is what looks best so far, being logically sound (I think). But it doesn't work. Please, I need a hand with this.

    use:
    function mc_pager(e:KeyboardEvent):void{
        var myKey = e.keyCode;
        if (myKey == Keyboard.PAGE_DOWN){
    symb.removeEventListener(KeyboardEvent.KEY_DOWN, mc_pager);
                symb.play(); // it plays, then checks if the lbl is null or final, then quits
                trace("current: " + symb.currentFrameLabel);
                 symb.addEventListener(Event.ENTER_FRAME,checkNextFrameF);
        if (myKey == Keyboard.PAGE_UP){
           symb.addEventListener(Event.ENTER_FRAME,checkPrevFrameF);
    function checkNextFrameF(e:Event):void{
    if(i don't know what you want to check here || symb.currentFrame==symb.totalFrames);
            symb.stop();
    symb.removeEventListener(Event.ENTER_FRAME,checkNextFrameF);
    symb.addEventListener(KeyboardEvent.KEY_DOWN, mc_pager);
    whatever else
    function checkPrevFrameF(e:Event):void{
    symb.prevFrame();
    if(i don't konw what you want to check here || symb.currentFrame==1){
    symb.removeEventListener(Event.ENTER_FRAME,checkPrevFrameF);
    symb.addEventListener(KeyboardEvent.KEY_DOWN, mc_pager);
    //whatever else

  • Center Next Nested Movieclip to Center of Stage

    I have 4 image movieclips nested inside of a "strip" movieclip and want to move horizontally to the next image using a mouse event. It is not centering and I don't understand why the if statements aren't working.
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var targetX:Number = (stage.stageWidth / 2 - strip.img02.x - strip.img02.width) / 2;
    var myTween:Tween = new Tween(strip, "x", Elastic.easeOut, strip.x, targetX, 3, true);
    rightbtn.addEventListener(MouseEvent.CLICK, right);
    function right(e:MouseEvent):void{
        if (var targetX:Number = (stage.stageWidth / 2 - strip.img01.x - strip.img01.width) / 2;)
            var targetX:Number = (stage.stageWidth / 2 - strip.img02.x - strip.img02.width) / 2;
            var myTween:Tween = new Tween(strip, "x", Elastic.easeOut, strip.x, targetX, 3, true);
        else if (var targetX:Number = (stage.stageWidth / 2 - strip.img02.x - strip.img02.width) / 2;)
            var targetX:Number = (stage.stageWidth / 2 - strip.img03.x - strip.img03.width) / 2;
            var myTween:Tween = new Tween(strip, "x", Elastic.easeOut, strip.x, targetX, 3, true);

    please don't open duplicate threads.

  • Painfully slow - nested movieclips?

    Hi folks, I'm not a programmer by any stretch so apologies for any blind ignorance in advance...
    I'm converting my old AS1 website to AS3 and testing it out as an iPhone App - basically it consists of adding dynamic movieclips to a stage, each one having multiple animated nested clips inside it - basically it's this: www.instantkamasutra.co.uk
    The problem is it's ridiculously slow - could it be because I'm rendering multiple nested vector graphics per frame? If I can help matters by caching a bitmap for each nested vector graphic, how would I do this?
    Would it help if I imported each nested clip as a bitmap graphic into Flash intstead of a relying on a Flash vector? Would this reduce the load on the processor?
    Thanks
    Neil

    Here are two good links on optimizing flash applications for mobile devices.  I think if you read through all of it you'll find several useful tips on how to optimize your code. You definitely need to use cacheAsBitmap for your vectors when possible.  However, this can cause problems if you are doing that  where the visual content changes often.  Also, you need need to remove all event listeners when you no longer need them. This will free up a lot of memory in your application. Pay close attention to the second link (Part 2) as it directly addresses some of the issues you are having.
    http://insideria.com/2010/11/flash-player-101-mobile-optimi.html
    http://insideria.com/2010/11/optimize-flash-content-and-imp.html

  • CacheAsBitmap question --- nested MovieClips

    I have a MovieClip which is a base (defined by a custom
    class) holding a
    bunch of loaders, holders, etc. After the whole MovieClip is
    built up I
    have a startDrag being called for the onPress event. Changing
    the base
    MovieClip (the one that is actually dragging) to "use runtime
    bitmap
    caching" has significantly improved the drag quality and that
    makes sense.
    My question is whether I can get any better performance by
    doing the same to
    the nested clips? Or, does the application to the base MC
    (the one holding
    everything else) handle it the best way?
    Also, is the cacheAsBitmap property the same thing as the
    "use runtime
    bitmap caching?"
    Thanks

    for main container only
    if the nested sprites have animations themselves, then cacheAsBitmap is not a good choice:
    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e35.html

  • How do you run loop functions on specific frames of nested Movieclips?

    I'm still pretty new to AS3 and I've run into a problem that I never had with AS2.  I have a project where the 1st frame of the main timeline is the loading screen and the second frame has buttons and a title bar that I want to be on every "page" of my project.  There are 7 buttons that take the user between 7 different "pages", which consist of 7 frames of a movieclip I have filling the content area on frame 2 of my main timeline.  I'll call this movieclip "pages_mc".
    The problem is that frame 6 of the pages_mc movieclip has the following code:
    var moving = 0;
    var xmoved;
    var xbegin = pano_cont.pano_image.x;
    parts_mc.addEventListener(Event.ENTER_FRAME, moveImage); // constantly moves the image 1 pixel left or right depending on the button pressed
    btn_left.addEventListener(MouseEvent.MOUSE_DOWN, moveLeft); //changes the variable "moving" to 2 on mouse down
    btn_right.addEventListener(MouseEvent.MOUSE_DOWN, moveRight); //changes the variable "moving" to 1 on mouse down
    btn_left.addEventListener(MouseEvent.MOUSE_UP, stopMoveLeft); //changes the variable "moving" to 0 on mouse up
    btn_right.addEventListener(MouseEvent.MOUSE_UP, stopMoveRight); //changes the variable "moving" to 0 on mouse up
    function moveImage(e.Event):void{
    xmoved = xbegin - pano_cont.pano_image.x;
        if(moving == 1)
            pano_cont.pano_image.x -= 1;
        if(moving == 2)
            pano_cont.pano_image.x += 1;
        if(xmoved < -(pano_cont.pano_image.width/2)+180)
            pano_cont.pano_image.x = -2538;
        if(xmoved > (pano_cont.pano_image.width/2)- 180)
            pano_cont.pano_image.x = -2178;
    function moveRight (e:MouseEvent):void
        btn_right.gotoAndStop("down");
        moving = 1;
    function moveLeft (e:MouseEvent):void
        btn_left.gotoAndStop("down");
        moving = 2;
    function stopMoveLeft (e:MouseEvent):void
        moving = 0;
        btn_left.gotoAndStop("active");
    function stopMoveRight (e:MouseEvent):void
        moving = 0;
        btn_right.gotoAndStop("active");
    This is all just some code to allow users to move a panaromic image around on the screen.  But when I navigate to a different page from of my pages_mc movieclip I get the following output message:
    TypeError: Error #1099: Cannot access a property or method of a null object reference.
         at SampleProject_fla::Content_MC_1/moveImage()
    I'm thinking this is happening because the "parts_mc" movieclip I referenced for the ENTER_FRAME event listener no longer exists (unless you go back to frame 6 of pages_mc).  I'm not sure how to remove this event listener when the user moves to another frame of pages_mc.
    Any help would be greatly appreciated.

    kglad wrote:
    what's parts_mc.parts_mc???
    Not sure where you see that.  I see pages_mc.parts_mc which is just because the parts_mc movieclip is nested on the 6th frame of the pages_mc movieclip.
    At any rate, I was able to get it working by moving all the code onto frame 2 of the main timline and declaring all of my vairables on frame 1 of the main timeline.  I then added an ENTER_FRAME event listener onto one of my movieclip buttons (main_btn) on the main timeline and had it check what frame the pages_mc movieclip was on.  If it was frame 6, I then executed the moveImage function and had it remove the event listener from the main_btn movieclip if the frame changed away from frame 6.
    Seems to be working so far.
    Here's the code:
    Frame 1
    /* Declaring variables. */
    var pagenumber:Number;
    var moving:Number = 0;
    var firstTime:Number = 0;
    var xmoved:Number;
    var xbegin:Number;
    Frame 2
    pages_mc.addEventListener(Event.ENTER_FRAME, pageNum);
    pages_mc.addEventListener(Event.ENTER_FRAME, BtnSelParts);
    /* Keeps track of current page. */
    function pageNum(e:Event):void
        pagenumber = pages_mc.currentFrame;
        title_bar.gotoAndStop(pages_mc.currentFrame);
    function BtnSelParts(e:Event):void
        if(pagenumber == 6)
            btn_parts.gotoAndStop("current");
            if(firstTime == 0)
                btn_main.addEventListener(Event.ENTER_FRAME, moveImage); //moves the panorama image left or right
        else
            if(btn_parts.currentFrame == 32)
                btn_parts.gotoAndStop(1);
    function moveImage(e:Event):void
        if(pagenumber==6)
            if(firstTime == 0)
                pages_mc.btn_left.addEventListener(MouseEvent.MOUSE_OVER, overLeft); //animates left arrow button on rollover
                pages_mc.btn_right.addEventListener(MouseEvent.MOUSE_OVER, overRight); //animates right arrow button on rollover
                pages_mc.btn_left.addEventListener(MouseEvent.MOUSE_DOWN, moveLeft); //changes the variable "moving" to 2 on mouse down
                pages_mc.btn_right.addEventListener(MouseEvent.MOUSE_DOWN, moveRight); //changes the variable "moving" to 1 on mouse down
                pages_mc.btn_left.addEventListener(MouseEvent.MOUSE_UP, stopMoveLeft); //changes the variable "moving" to 0 on mouse up
                pages_mc.btn_right.addEventListener(MouseEvent.MOUSE_UP, stopMoveRight); //changes the variable "moving" to 0 on mouse up
                pages_mc.btn_left.addEventListener(MouseEvent.MOUSE_OUT, rollOutLeft); //animates left arrow button on rollout
                pages_mc.btn_right.addEventListener(MouseEvent.MOUSE_OUT, rollOutRight); //animates right arrow button on rollout
                xbegin = pages_mc.parts_mc.pano_image.x;
                firstTime = 1;
            xmoved = xbegin - pages_mc.parts_mc.pano_image.x;
            if(moving == 1)
                pages_mc.parts_mc.pano_image.x -= 1;
            if(moving == 2)
                pages_mc.parts_mc.pano_image.x += 1;
            if(xmoved < -(pages_mc.parts_mc.pano_image.width/2)+180)
                pages_mc.parts_mc.pano_image.x = -2538;
            if(xmoved > (pages_mc.parts_mc.pano_image.width/2)- 180)
                pages_mc.parts_mc.pano_image.x = -2178;
            if(pages_mc.parts_mc.pano_image.pano1.currentFrame == 1)
                pages_mc.btn_sel.gotoAndStop(1);
            if(pages_mc.parts_mc.pano_image.pano1.currentFrame == 2)
                pages_mc.btn_sel.gotoAndStop(2);
            if(pages_mc.parts_mc.pano_image.pano1.currentFrame == 3)
                pages_mc.btn_sel.gotoAndStop(3);
        else
            btn_main.removeEventListener(Event.ENTER_FRAME, moveImage);
            firstTime = 0;
    } // controlls the panaromas
    Let me know if you see any problems with this.
    Thanks again.

  • CacheAsBitmap on nested movieclips/sprites?

    Hi. Regarding cacheAsBitmap, I was wondering whether to appy 'cacheAsBitmap' property on every nested sprites/movieclips or only on the main sprite/movieclip? In my case, I've one main container sprite, which has 3-4 sprites. These 3-4 sprites may also have children (shape/sprites). Now, I'm using scrollRect property of main container to scroll. I've set 'cacheAsBitmap' property to true for every single child/sub-child of the main container and of course to the main container as well. So, my question is, do I need to set for main container only or for every single child -it may have?

    for main container only
    if the nested sprites have animations themselves, then cacheAsBitmap is not a good choice:
    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e35.html

  • 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

  • Accessing stage from nested movieclip

    I have the following code nested in a movieclip, how can I reference the stage correctly from that movieclip?
    stage.addEventListener(KeyboardEvent.KEY_DOWN, reactToArrowKeys);
    function reactToArrowKeys(keyEvent:KeyboardEvent):void
         if (keyEvent.keyCode == 37)
              trace("Left Arrow pressed.");
         else if (keyEvent.keyCode == 39)
              trace("Right Arrow pressed.");

    there's never a situation that requires code be nested in a child movieclips and there are good reasons to avoid any significant (eg, more than a stop() ) code on child movieclips.

  • Invisible text in nested movieclip

    Hi every one!
    Is it somehow possible to display dynamic text that is first
    loaded into a container (movieclip) in one .swf which is then
    loaded into a container i another .swf? I've tried to do this but
    without any luck so far. Ive embedded both the font (Arial) and
    characters used, which did not do the trick...
    Can someone please help me?

    Hi!
    Thanks for the fast reply :-)
    Yes i use the setTextFormat for the links in the .as file. I
    tried to out comment it and it only changed the formatting of the
    text when i publish find_job.swf, when I run it through the main
    menu (the parent file) there is still no text visible...
    I didn't use htmlText for the links, so I thought that maybe
    that was the problem, but when I change the text to htmlText and
    set it to true there is no difference.
    I'm not a programmer (far from it) so in order to find out if
    it was problems in the code, I've tried to make some simple test
    files. I have a parent swf (loadText.swf) with a container
    ("container") which loads textfile.swf. Textfile.swf holds a
    dynamic textfield, that I entered text into, and the same problem
    occurs. I don't know if it's a path-problem or...?

  • Movieclip registration point defaulting to top left of nested movieclip when placed on stage

    basicaly there is a movieclip holding multiple movieclips with animations that pass from right to left making the overall registration point of the parent MC to somewhere right of the stage
    in the parent movieclip there is a background that is the exact size and placement of the stage and the top left of that background is where the parents registration point is being loaded at..I
    I'm not sure if this has any relivance but i defined the movieclip as a variable and placed that variable at the specified coords..
    addChild(PLevel);
        PLevel.x = w/2;
        PLevel.y = h;
    where w is the max width of screen  and h is the min height
    my registration for that moveclip would be the bottom of the movieclip centered on the stage background

    I can't find anything of a question or problem in your posting.  You mention three different locations for registration points, but I am unable to determine anything from your doing so.

Maybe you are looking for