ActionScript in Main Timeline

On the first frame of the main timeline I have the following
script, but it does not work. Can anyone tell me why? The fla file
is at
http://www.rickcornett.com/drop.down.fla
stop();
who_btn.onRelease = function () {
_root.gotoAndStop("advertising");
The who_btn is nested within the "drop" movie clip ---->
"bar" movie clip.
I've accomplished this already by just attaching a script to
the who_btn, just trying to figure out how I could've made it work
with the code on the main timeline. Any and all help is much
appreciated! Thanks.
Text

The target path to the button is wrong. Select the 'overview'
mc on the stage (your layer 'Layer 1' should be selected now) and
check the Property Inspector. You didn't assign an instance name.
Give it an instance name 'overview_mc' and use the following
script:
overview_mc.drop.who_btn.onRelease = function () {
_root.gotoAndStop("advertising");
}

Similar Messages

  • In actionscript 3.0 how do i make a nested movie clip button go to a frame on the main timeline

    I am making a website based in flash actionscript 3.0 i have a button nested in its own movie clip, because I have the button expanding to be able to read it i have figured out the only way to do this is by creating it as a movie clipa nd inside the movie clip creating it as a button
    I added an event listener to the blog button by saying,
    blog.addEventListener(MouseEvent.ROLL_OVER,gotoblog);
    function gotoblog(evtobj:MouseEvent){
         gotoAndStop(2)
    this part of the code works it goes to the 2nd frame of the timeline it is in and stops wich is a blown up version of the origanal symbol
    i added on frame 2 a second command
    blog.addEventListener(MouseEvent.CLICK.gotoblogpage);
    function gotoblogpage(evtobj:MouseEvent){
    gotoAndStop("blogframe")
    trace("the blog button was clicked")
    i have named the symbol blog and have name the frame of where the blog page is going to be "blogframe" this line of code at the bottom is where i run into trouble the output window in Flash is saying "The blog button was clicked" just like i want it to. no errors are accouring why than is the playhead not going to frame "blogframe"? if the button is working when i click it the code is right i belive the problem here is it does not want the playhead to go to the frame i want it to. So i gues my question is, how can i make a button withing a movie clip interact with the main timeline?

    I have a similar problem if could please help me i'd really apreciate it!!
    So i have a looping animation of some thumbnails, the hierarchy goes like this
    Scene1(main timeline) -> imgBar(MC)->imgBarB(MC within the imgBar MC)
    My buttons symbols are in the last MC "imgBarB" where i have this code:
    ss1.addEventListener(MouseEvent.CLICK, OneButtonClicked);
      function OneButtonClicked(event:MouseEvent):void{
      MovieClip(root).gotoAndStop("ssbox1");
    I want to control the Btns in my "imgBarB" MC to play a labeled frame(named "ssbox1") on another MC on the main timeline,this other MC goes like this:
    Scene1(main timeline)->ssbox_mc(MC where my labeled frame is)

  • Actionscript is on main timeline: Error #1009 comes up.

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at neonSign_fla::MainTimeline/flickerIt()
    The Code on Frame 1:
    import flash.filters.*;
    var audio:Sound = new Sound();
    var req:URLRequest = new URLRequest("Buzz.mp3");
    audio.load(req);
    audio.play();
    //var channel:SoundChannel= new SoundChannel();
    addEventListener(Event.ENTER_FRAME, flickerIt);
    //addEventListener(Event.EXIT_FRAME, killIt);
    function flickerIt(evt:Event):void{
    var filters:Array = sign.filters;
    var glow:GlowFilter = filters[2];
    glow.strength = Math.random()*.5 + .35;
    sign.filters = filters ;
    So Why am I receiving the error when the actionscript is on the main timeline.

    The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
    - is not in the display list
    - doesn't have an instance name (or the instance name is mispelled)
    - does not exist in the frame where that code is trying to talk to it
    - is animated into place but is not assigned instance names in every keyframe for it
    - is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).
    If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

  • How can I reference the main timeline on a swf once it was loaded into another?

    I have an swf with some custon animation functions using actionscript 3. I'm refering to the main timeline with Movieclip(root) and it works just fine.
    However, this swf is going to be loaded inside another (a custom player), and when that happends, everything stops working.
    I think it's because the Movieclip(root) is now referencing to the loader swf and not the loaded anymore, but I just can't find any information on how to fix that.

    This is basically what I´m doing here:
    I'm placing this code on frame 1, and calling the function textAnimate() whenever I need to insert some text.
    // This is a variable I created for tracking the timeline
    var base:MovieClip = MovieClip(root);
    function textAnimate(movieName:String, espera:Number):void {
              //var espera:Number = 1; //Waiting time
              var objeto:MovieClip = base[movieName]; //Variable to select the object
              var posFinal:Number = objeto.x; // Object position
              var posEnter:String = "-160"; // Animation start (relative)
              var posExit:String = "+160"; // Animation end (relative)
              // enter animation
              TweenMax.from(objeto, 1, {x:posEnter, alpha:0, blurFilter:{blurX:40}, ease:Back.easeOut});
              //call exitAnimation() after X seconds
              TweenMax.delayedCall(espera,exitAnimation);
              //exit animation
              function exitAnimation() {
                        TweenMax.to(objeto, 1, {x:posExit, alpha:0, blurFilter:{blurX:40}, ease:Back.easeIn});
    The swf works fine, but once it´s loaded into the player, nothing works anymore. Unfortunately, I don't have the code for the player, and can't change anything about it... :/

  • How do I recerence Movie Clips on the Main Timeline from inside a class?

    Hey everyone, this might be a stupid question but I thought
    I'd ask cause it's making me nuts. I'm all of 2 days into AS3
    (coming from not using Flash at all in YEARS) so feel free to
    consider me ignorant. I do have plenty of application development
    experience in other areas though.
    I can't seem to create a class that can reference an instance
    of a movie clip on my main timeline. I'd post code of what I've
    tried but I've gone through so many desperate edits & wild
    guesses that it was just garbled junk before I deleted it all.
    Basically here's how I figured Flash could work, though maybe
    it doesn't work this way at all.
    I'm assuming that with AS 3 being so big on being a true
    object oriented environment, I wouldn't need to mix my code and
    interface together. Preferably I'd be using the Flash authoring
    tools just to design my interface. Create a button... place it
    somewhere... give it an instance name. Roughly the equivilant of
    Apple's InterfaceBuilder for those of you that might be familiar
    with Cocoa development. I can see maybe having to put a few lines
    of ActionScript onto frame 1 (though really I'm hoping Flash would
    have a better method of kicking off the application at this point
    that using code tied to frames) to load my classes & such, but
    after that I'd like all of my code to be held in external class
    files.
    So maybe I've got:
    Interface.fla - My interface
    Button_1
    Button_2
    TextField_1
    Main.as - My main controller class using to handle all of my
    applications behavior
    SomeClass.as - Some helper Class
    SomeOtherClass.as - Some helper Class
    Main.as would have instructions in its initialization method
    to go ahead & attach events to buttons & initialize
    anything else that needs to happen when the application starts.
    From there on it would all be objects communicating back &
    forth. Button_1 would get clicked with would fire
    Main.someMethod(). Main.someMethod() would then do it's thing and
    set the value of TextField_1. All very clean & code is very
    separated from interface.
    Unfortunately I can't for the life of me figure out how AS3
    classes reference each other like that. There doesn't seem to be
    any kind of a global 'root' or '_root' I can use to locate any
    movie clips on the stage. I've searched the help & the web for
    any kind of simple tutorial but to no avail. My job has tasked me
    with building a flash app for a project but I'd really rather not
    have a tone of ActionScript just shoved into frame 1. That just
    seems... ugh! (::shudder::)
    Can someone maybe point me in the right direction here? I'm
    really willing to do my homework but I can't seem to locate the
    info I need to get started. Also, is there an ActionScript IRC
    channel or something maybe?
    Thanks,
    Cliff

    I worked with the problem last night and the solution I
    started coming to involved creating my own custom document class
    based off which extends MovieClip. My thought is that way I have
    access to the initialization routine of the timeline itself and
    that all of the elements on the main timeline should be
    "properties" of my custom class.
    Is this correct? Is there a down side to doing this & if
    so what is it & why?
    Also, just for my reference, the last time I did anything
    with ActionScript I think I was using '_root' to target the main
    timeline. WHat are the global variable names in AS 3? Is it just
    'root' & 'stage' or 'Root' & 'Stage' or what?

  • Moving to a frame in Movieclip timeline from the main timeline

    I am in the learning process. Working with FlashCS5 and AS3.
    Please bear with me if the issue appears to be too simple for you. Placed a movieclip(mcassessJohn) on the main timeline and moved to the frame labelled "johnFeedback" in the movieclip timeline using the following actionscript code.
    mcassessJohn.addEventListener(MouseEvent.CLICK, onJohnClick);
    function onJohnClick(evt:MouseEvent):void {
       mcassessJohn.gotoAndPlay("johnFeedback");
    This works fine. However problem starts when I place a button "questionJohn" in the movieclip(mcassessJohn) time line at frame "johnFeedback" and try to move to another frame by clicking the button and using the following actionscript code;
    questionJohn.addEventListener(MouseEventClick,onClick);
    function onClick(evt:MouseEvent):void {
      gotoAnd Play("johnFeedback");
    Placed the above code in actions layer in the movieclip timeline at frame "johnFeedback". I had placed the button also in the movieclip timeline at Frame "johnFeedback in layer buttons. No compiler error.No runtime error. Just nothing happens when I click on the button "questionJohn".
    Would appreciate if you can let me know where I am going wrong.

    Thats because if u assign the listeners to a parent movieclip it will not pickup listener assigned to its child.
    A work around is put a invisible btn inside mcassessJohn movieclip on frame 1 and assign onJohnClick function to that.
    And one more thing, i think u r trying to perform same operation on both the btns
    http://www.darshanrane.com

  • Attempt to move main timeline from inside a movie clip breaks menu buttons.

    I am attempting to have the main timeline move from a stopped position over a movie clip to frame 1, where my start menu is.
    The code I'm using does move the timeline but in doing so it somehow breaks the 4 buttons I have in frame 1.
    My code in the movie clip:
    stop()
    function replayMovie(event:MouseEvent):void
    MovieClip(parent).gotoAndStop(1);
    Menu.addEventListener(MouseEvent.CLICK, replayMovie);
    My code in frame 1 of the main timeline:
    stop();
    function bo(event:MouseEvent):void
    gotoAndPlay(21)
    SoundMixer.stopAll()
    espesp.addEventListener(MouseEvent.CLICK, bo);
    function ho(event:MouseEvent):void
    gotoAndPlay(31)
    SoundMixer.stopAll()
    espeng.addEventListener(MouseEvent.CLICK, ho);
    function yo(event:MouseEvent):void
    gotoAndPlay(41)
    SoundMixer.stopAll()
    engesp.addEventListener(MouseEvent.CLICK, yo);
    function go(event:MouseEvent):void
    gotoAndPlay(51)
    SoundMixer.stopAll()
    engeng.addEventListener(MouseEvent.CLICK, go);
    The error output when I use my Menu button at the end of the movie clip.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at SSubjunctiveProjNewgrounds_fla::MainTimeline/frame1()
    at flash.display::MovieClip/gotoAndStop()
    at SSubjunctiveProjNewgrounds_fla::Esp_5/replayMovie()
    Any help would be greatly appreciated.

    For the sake of space, I'll leave out all the package declarations and class declarations and just talk about the functions.
    First, the Game class, it has two functions.  The first one is the constructor function and it launches at the beginning of the game:  First the Game function:
    public function Game():void
    //Game code goes here
    }//Game
    We want to listen for someone to click the mouse on the MenuPage, so lets create a new MenuPage and add a listener to the button contiained within it.
    public function Game():void
    menuPage = new MenuPage;
    menuPage.startButton.addEventListener(MouseEvent.CLICK, startGame);
    addChild(menuPage);
    }//Game
    You will notice that before I declared a variable var menuPage:MenuPage, but that's all I did was declare it.  I didn't really make a new instance of it, I just set aside space for it.  In the first line within the Game function, I'm actually turning that variable into a new instance of a MenuPage.
    We don't have a picture of this imaginary menuPage instance, but lets' assume that in our MenuPage MovieClip in the library, we created a SimpleButton called startButton.  Here, I'm adding an EventListener that patiently waits for someone to click that button.  Once we receive that event, Flash is told to call the startGame function.
    As you get better at this, you'll get into custom events, and the eventListener for the button will exist in the MenuPage class file, or even in another class file that you create just for the button.  Something like StartButton.as  But for now, we can do it as above.
    Now the startGame function:
              public function startGame(evt:MouseEvent):void
    //Remove the start Page
    //Add the zombie
    //Add the gun
    }//startGame
    And we'll replace those comments with real code.  It follows along with what we just did above.
    public function startGame(evt:MouseEvent):void
    zombie = new Zombie;
    addChild(zombie);
    gun = new Gun;
    addChild(gun);
    And we also want to clean up some by removing the menuPage, and throwing out the eventListener.
    public function startGame(evt:MouseEvent):void
    zombie = new Zombie;
    addChild(zombie);
    gun = new Gun;
    addChild(gun);
    menuPage.startButton.removeEventListener(MouseEvent.Click,startGame);
    removeChild(menuPage);
    }//startGame
    Now our Game class is complete.
    The Zombie Class
    public function zombieWalk(evt:Event):void
    this.addEventListener(Event.ENTER_FRAME,zombieWalk);
    this.x = this.x + 10;
    }//zombieWalk
    Notice we've added a function to the Zombie Class.
    The first function adds an EventListener to the zombie.  We can use the word this and actionScript knows we're talking about the zombie that the class is written for.  This listener fires off every frame.  If our FLA file is set to 12fps, then 12 times every second it will call on the zombieWalk function.
    The zombie walk function moves the zombie 10 pixels to the right every time the function is called.
    On a more advanced level, you'll want to add animation in the MovieClip to move the zombie legs.  You'll also want to use Timer events to space out how often the funtion fires and not ENTER_FRAME events.  And you'll want to use a static constant to establish how far the zombie moves.  We have it now set to 10 pixels, but that can get irritating if we want to change that value later.  But again, baby steps.
    And finally, the Gun class
    public function Gun():void
    this.addEventListener(MouseEvent.CLICK, fireGun);
    }//function
    public function fireGun(evt:MouseEvent):void
    this.gotoAndPlay(2);
    }//fireGun
    First we add an EventListener for when someone clicks on the gun.  Once this happens, the listener calls on the fireGun function.
    The fireGun function takes advantage of the frames within the Gun MovieClip.  Say we have three frames in the Gun MovieClip.  The first is just a picture of the gun.  The second is the gun with a flash coming out of the nozzle.  And the third is the gun at rest again.  The line this.gotoAndPlay(2) sends the gun to the second frame with the flash graphic.
    For this to work, each frame in the Gun MovieClip has to have some stop and play commands.
    But.. you said no code on our timeline!! Liar!
    I know.  This is the exception.  You will need basic stop() commands and gotoAndPlay commands to loop animations.  Any MovieClip that has more than one frame will need something to control it.
    So our Gun MovieCLip has the following:
    Frame 1: stop();
    Frame 2: no actionScript... and I mean nothing, not even the words, "no actionScript"
    Frame 3: gotoAndStop(1);
    This will loop the gun to the beginning and wait for the next time the user clicks the gun.
    Advanced features of the Gun class might include a Bullet.as sub-class that creates a bullet MovieClip to fly across the screen.  Sound to play when the shooting takes place.  Object collision detection to see if the bullet hits the target.  And a means by which a custom event will tell the Game.as class that a zombie has been hit and it should be removed from the stage.
    As you go down the rabbit hole of ActionScript 3, you will find yourself at a point where it's just a matter of getting the syntax right for all the built in functions and classes.  Arrays, Loaders, casting variable types.. all that stuff will come.
    I hope this has been helfpul.  It's been on my to-do list for a long time.  When I first started out, no one could provide me with basic answers for how all these classes and whatnot worked.  After teaching myself AS3 for 2 years and reading a gabillion books, I think I've gotten to a point where I'm pretty comfortable with it all.

  • How to link from a movie clip to main timeline?

    My problem first appeared very simple, but I have spent a
    while on it and can't think how to solve it. I must say that I am
    very much an amateur in designing in Flash and ActionScript.
    I created a movie clip containing an embedded video and a
    sound clip. In the main timeline I inserted the movie clip into a
    keyframe. When I found the movie clip didn't play, I discovered
    that the only way of making it play was to place a Stop action in
    the keyframe of the movie clip, and also set the whole movie to
    loop. The Stop action stopped the whole movie from looping, but
    instead made the movie clip loop. If the keyframe is on frame 456,
    how do I make it advance onto frame 457 once the movie clip has
    finished running?
    I've tried various ways around the problem, including placing
    a button inside the movie clip to Go to and Play frame 457, but
    instead it plays frame 457 in the movie clip.
    Can anyone help me with this please?

    Hello,
    You need to tell flash the "target" you want to play. If not
    specified
    it will think it is the target you are calling from which in
    your case
    is the movie clip.
    So to go back and play one level up would be:
    _parent.gotoAndPlay(457);
    If the movie clip was inside another movie clip then it would
    be:
    _parent._parent.gotoAndPlay(457);
    or you can just referent the root of the movie directly:
    _root.gotoAndPlay(457);
    Search the help file for timeline target and you should find
    more about it.
    Incubusguy wrote:
    > My problem first appeared very simple, but I have spent
    a while on it and can't
    > think how to solve it. I must say that I am very much an
    amateur in designing
    > in Flash and ActionScript.
    >
    > I created a movie clip containing an embedded video and
    a sound clip. In the
    > main timeline I inserted the movie clip into a keyframe.
    When I found the movie
    > clip didn't play, I discovered that the only way of
    making it play was to place
    > a Stop action in the keyframe of the movie clip, and
    also set the whole movie
    > to loop. The Stop action stopped the whole movie from
    looping, but instead made
    > the movie clip loop. If the keyframe is on frame 456,
    how do I make it advance
    > onto frame 457 once the movie clip has finished running?
    >
    > I've tried various ways around the problem, including
    placing a button inside
    > the movie clip to Go to and Play frame 457, but instead
    it plays frame 457 in
    > the movie clip.
    >
    > Can anyone help me with this please?
    >
    >

  • Button in movieclip to main timeline

    I have a button(A) that opens a movie clip which contains a
    button (B). I want button B to go to and play a frame on the main
    timeline, NOT a frame in the movieclip. Is this possible?
    If not, what I am aiming for is a menu of buttons, that are
    rollovers from which another menu pops up with buttons you can
    click.
    Help!
    Thanks

    Hi, Sorry I am new to ActionScript.
    This is what I wrote:
    this.menu_orange1.addEventListener(MouseEvent.CLICK,clickListener2);
    function clickListener2(event:MouseEvent):void {
    _root.gotoAndPlay("test");
    and the error message says:
    1120: Access of undefined property _root.

  • Load a MC on the main timeline from a MC.     AS3

    I have a movie clip (mc_menu) on that is on the main timeline.
    This movie clip has buttons that I want to use to display other movie clips on the main (parent) timeline.

    Start here:
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7e4e.html

  • Controlling main timeline from loaded movie

    I have loaded an external movie onto the main movie in a
    movie clip called "mainholder" - In the main timeline on the main
    movie there is a "stop" command on frame 1. From the loaded movie,
    I want to control the main timeline and tell it to go to frame 2.
    Can someone tell me the actionscripting to do this, I have tried
    several commands and getting frustrated. ;-)
    Thanks

    movies are loaded into levels. The main movie is always
    considered level0 a.k.a _root in the AS. When you load a movie into
    another, the main movie is also considered the parent of that
    loaded movie a.k.a. this._parent in AS where this refers to the
    loaded movie. If you want something in the loaded movie to control
    the main timeline you could call it like this...
    _root.gotoAndStop(2); or _root.gotoAndPlay(2); depending on
    what you want.
    but because of the parent/child relationship, it can also be
    done like this....
    this._parent.gotoAndStop(2); or this._parent.gotoAndPlay(2)
    Although the first method is less to remember, the second
    method proves the most friendly and re-usable. Let me explain...
    Say that you did something like this....
    [MAIN MOVIE]
    [LOADED MOVIE]
    {Loaded Movie with buttons to control LOADED MOVIE}
    Your main movie loads a movie and when this loaded movie
    reaches it's 10th frame, it loads another movie where the buttons
    reside for controlling that clip. If you used _root in the button
    movie, it would cause the main movie (_root) to be called and not
    the LOADED MOVIE as you had intended during its design prior to
    trying to make this new main movie (and it would work as intended
    if you opened the LOADED MOVIE's fla file and exported). If you use
    this._parent in the button movie, it will always make it's calls to
    the LOADED MOVIE's timeline and not the main clips timeline.
    Sorry if this confuses you but it's important to
    understand.

  • Navigate on Main Timeline using Custom .as

    OK, I'm back, and I have another issue that's bogging me down.
    The project I am working on has individual frames, each of which holds separate movie clips.  Within those movieclips are buttons which allow the user to navigate to the next frame in the main timeline.  The button objects are different in each frame, so these aren't objects that I can just put on the main timeline (some are nested within several objects)
    I want to be able to use a line like:
    myButton.addEventListener(MouseEvent.CLICK, rootnextframe);
    and not have to always then follow that up with the function declaration. I've tried just declaring the function on the main timeline, but when the script within the objects call the function, it doesn't see it.
    I have created an actionscript file that reads:
    package {
        public function rootnextframe():void {
            MovieClip(root).nextFrame();
    but I get the errors:
    Call to a possible undefined method MovieClip.
    Access of undefined property root.
    So, clearly, I'm going about this all wrong.  I feel like it's a waste to have a function that has only one line, but I can't think of any other ways to do what I'm trying to get it to do.  Anyone have any ideas?

    I have to run but here's another approach that you can take:
    In the code (probably an event listener) where you determine what frame you're on ( 3 or 6 ), dispatch a new custom bubbling event, and then listen for that event in the main timeline.
    Pseudo code:
    function nextFramePopup(event:Event)
         if (currentFrame == 3)
              //doStuff
              dispatchEvent(new Event("advanceFrame", true));
         else
              //doOtherStuff
              //popUpWindow()
    and in main timeline on frame 1
    addEventListener("advanceFrame", handleAdvanceFrame);
    function handleAdvanceFrame(event:Event):void
         //do your next frame thing here
    ts

  • Use button on mc  to perfrom function on main timeline

    I Was wondering how (or if it is posiible) to use a button I
    have in a movie clip to perform a function on the main timeline.
    Specifically, I want the button in the movie clip to gotoAndStop on
    a frame in the main timeline. Any suggestions?

    Hi,
    Then you would target the movie clip.
    So you would give the mc an instance name (like myClip_mc )
    then just add this into your code ....
    button1.onRelease = function() {
    _root.myClip_mc.gotoAndStop(20);
    This would tell the myClip_mc to stop on frame 20. Providing
    the mc is located in the main timeline that is.
    You can see from the code that we are going to the _root and
    looking for the myClip_mc. If it is held within another mc (say
    Holder_mc) then the code would change to
    _root.Holder_mc.myClip_mc.gotoAndStop(20;
    for cs3 (actionscript 3) it would be this
    button1.addEventListener(MouseEvent.CLICK,clickHandler);
    function clickHandler(event:MouseEvent):void{
    _root.myClip_mc.gotoAndStop(20);
    Hope this helps
    Alan

  • Accessing the main timeline

    Hello,
    I have multiple instances of a movieclip (a1) within the main timeline.  These instances move around via tweening within the main timeline.  The instances also appear (are added) and disappear (are removed) while the main timeline is playing.
    Within the movieclip is this actionscript:
    (code)
    addEventListener(Event.ENTER_FRAME, ef);
    function ef(evt:Event):void
         trace(MovieClip(parent).currentFrame);
    (end code)
    As soon as an instance disappears... I get this typeError:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at test13_fla::a1_1/ef()
    The question then is - How can I access the main timeline from each instance (even when it is not currently on stage)?  Is this possible?  Any suggestions on how I can keep all of my code within the movieclip?
    Thanks in advance!
    -Jake

    Throughout the timeline the instances are in a motiontween followed by a blank keyframe. 
    To remove the event listener when it does dissappear I could do a addEventListener(Event.Removed, removeEventListenerFn);.... but I need a way to keep it.
    In my real project, each instance draws itself via drawRect and then put into a sprite and added to the main timeline.  Then within the event function (where it traces the maintimelines current frame)  I need all of the sprites to be removed when the main timeline gets to a certain frame#.  I know... confusing...
    I just need to find a way to access the main timeline while the instance is removed from the stage.
    If, for example, I did this...
    (code)
    addEventListener(Event.REMOVED, ef);
    var ccc:Number = 1;
    function ef(evt:Event):void
         trace("First Removed: " + MovieClip(root).currentFrame);
         addEventListener(Event.ENTER_FRAME, eg);
    function eg(evt:Event):void
         if(ccc < 10)
              trace("I am now removed");
         ccc++;
    (end code)
    ... I do not get any errors and I would get this in the output window:
    First Removed: 59
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed

  • Communicating with main timeline symbols

    Hi, i created a movieclip and exported it to Actionscript. I have a few instances of the new symbol(class) on the main time line and i have some
    code on the class timeline. im trying to communicate with a movieclip instance that located in the main time line but for some reason im getting
    an error. the name of the movieclip instance is mcGalleryWin. im pretty sure that the root keyword worked for me before in a similar situation
    but for some reason its not workin now...
    I tried to trace (root) from the class and i do get the main timeline.
    code:
    imageLdr.load(imageReq);
        imageLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, firstImageLoaded);
        function firstImageLoaded(event:Event){
            root.mcGalleryWin.addChild(imageLdr);
    error:
    1119: Access of possibly undefined property mcGalleryWin through a reference with static type flash.display:DisplayObject.

    thanks, it works....
    how funny i tried to do that in a different way :
    MovieClip(root.mcGalleryWin).addChild(imageLdr); but it didn't work....
    anyway, thanks alot !!!

Maybe you are looking for

  • Basic set up Point to my DNS

    Hello, I seem to have problems understanding the help files on one part of OS X server setup for DNS hosting. Here is my basic set up. I currently have my godaddy hosted domain pointing to my server ns3.uncinc.net on a OS X 10.3 server. I have the se

  • How to Make a Line of Best Fit/Best Fit Line/Trendline in iWork Numbers '09

    I'm not sure if this is well-known or has been answered elsewhere already, but multiple Google searches have not shown this solution on how to create a line of best fit in Numbers '09 (there is another method that involves drawing a line yourself, bu

  • Bought a TV season, but it's not showing up in 'purchases'

    I just bought a TV season and chose the option to 'download later', but when I go to Quick Links > Purchases, it's not showing up at all. The funds have already been taken from my iTunes credit and I see the purchase receipt on my account page. I che

  • Different ways of syncing 2 MBPs - which is best?

    I have 2 MBPs - a 17 in, which is the main one, and a new 13 in, which I use "on the road" etc. I already used Migration assistant to make the 13in similar to the 17, but I know that in time, they will start to diverge again. They are often in physic

  • Is there a way to interactiv​ely select a worksheet from an Excel workbook in Labview?

    All of the examples that I can find only allow you to select a sheet by knowing it's index number or the exact name of the sheet.  I haven't been able to query or otherwise find out what sheets are in the workbook to allow the operator select one.