Jumping from Main Timeline to a specific frame of a MovieClip

Hello there!
I'm a begginer with Flash... and I am attending a course of fundamentals of Flash... so I apologize if my doubt is a too obvious answer to some of you.
The situation is as follows:
  I'm using Action Script 2.0 --- I'm obligated to in the course I'm attending.
  I have a main timeline that has 3 frames. On the 2nd frame I have a movieclip named mc_nbr. On the 3rd frame I have a button "voltar" that when pressed I want it to "Go and Stop/Play" at frame 3 of the movieclip (that is embedded on frame 2 of the main timeline).
I used the folowing code for the button btn_voltar:
on (press)
    _root.mc_nbr.gotoAndStop("3");
I tried as well with
on (press)
   this.mc_nbr.gotoAndStop("3");
None of them works!
I tried to see wheather the button even works and it does.
I included a input text box and the stament before the code shown above  like the one that follows:
feedback.text = "Pressionei o botão!";
So the part missing (and the important one) is jumping to the movieclip. I can't figure out how to do it !!!
I uploaded the "project" at http://www.megaupload.com/?d=A6M581US
Could anyone, please help me.
Thank You for your feedback.

Ron ron,
Thank you for your help... but either I'm not following You or I'm doing something really wrong.
I tried what you suggested but it doesn't solve my problem...
Were we talking about the same button ? (btn_voltar, from the 3rd frame)
Could you take a look at my file in http://www.megaupload.com/?d=A6M581US   ??

Similar Messages

  • Controlling loaded swf from main timeline

    Hello,
    I'm working on loading external swf files for ios. I am able to load the swf files and set them to visible or invisible in different frames. I am having trouble controlling the loaded swf files from the main timeline. Specifically, I would like to have a button on the main timeline, that when clicked will move a loaded swf to frame 1.
    Here is a code that loads one swf file:
    var myLoader1:Loader;
    var loaderContext1:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    if(myLoader1 == null)
              myLoader1 = new Loader();
              addChild(myLoader1);
    myLoader1.load(new URLRequest("folder/file1.swf"),loaderContext1);
    myLoader1.visible = true;
    backbutton.addEventListener(MouseEvent.MOUSE_DOWN, backbutton1);
    function backbutton1(myEvent:MouseEvent):void {???????????? myLoader1.gotoAndStop(1);}  (this line does not work)
    (Once I load file1.swf, within the file1.swf I click a forward button to move to different frames. My question is: how do I code the 'backbutton' on the main timeline so that it causes the loaded file1.swf to go to frame 1?)
    Thank you for your help.

    sure.
    if the movieclip on the loaded swf's main timeline has reference mc, you would use:
    MovieClip(myLoader.content).mc.gotoAndStop(1);
    p.s.  you might find the following helpful,  http://kb2.adobe.com/community/publishing/918/cpsid_91887.html

  • Navigating to Frame Label in mc from main timeline

    Lets say that in my main timeline, I have a number of frame
    labels. On stage I have a movie clip (let's call it bg_mc) which
    contains a tweened animation that has been looping repeatedly (so
    it has its own timeline with its own frame labels).
    I would like this to happen:
    - On the main timeline, the playhead enters a specific frame
    called "newBackground."
    - When that happens, I want the playhead in bg_mc to jump to
    the first frame in its timeline, "beginLoop."
    How do I accomplish this?
    Thanks so much for your help!
    David

    Now, this brings on another question... that is, what if the
    opposite is true?
    For instance:
    The main timeline plays to a stop(); at frame 10.
    At frame 10, a movie clip (countdown_mc) which contains a
    countdown timer, begins.
    When the timer reaches 00:00, I want to trigger the main
    timeline to continue and play the next frame (11).
    Thanks again for the great advice,
    David

  • Goto next frame in a movieclip from main timeline button

    So what I have is a button (named Next) on the main timeline. I have a movie clip on that frame (on the main timeline) and the movie clip has 3 frames that I want to be able to cycle through using the "Next" button that is on the main timeline. How can I go about doing this?
    Thank you,

    Thanks kglad! Works like a charm. :-)
    I had already named the instance of the movieclip and button so I just needed to change the code to match and it's working great.
    One other issue I've come up with now is that when it goes to the 3rd frame of the movieclip and I click next, it doesn't do anything. shouldn't it go back to frame 1 of the movieclip?

  • Control swf from main timeline

    i know i've done this before! i have a swf. 4 labels. a stop
    at frame 1. i embedd this into my main timeline. i have 4 butons in
    an MC in my main project, going to specific labels in my main
    timeline, where i have the following code, attempting to load the
    swf and jump to that label:
    this.container_shell.loadMovie("interact01.swf");
    interact_shellb.gotoAndStop("label1");
    its not working. the swf loads, but i can't jump to the
    label.
    any ideas? appologize for the basic question, i'm a designer,
    not a programmer!

    If you have a question to ask, you should start a new posting and include the code/info pertinent to your problem.  The one you are trying to catch a ride from is flawed and requires some questions to be answered.  Being that the posting is over 4 years old, it is unlikely the original poster is going to be answering any.

  • How link from html page to a specific frame in flash cs5 as3

    Hi!
    I'm kinda new around here. I am interested in knowing how to link from a specific html page to a specific frame in flash cs5 as3.
    I have a website that I originally began to design in flash but later started developing new pages for it in html. The flash part of it has several pages on different frames and I have created links from the flash part to the other html pages, but, I can only link the html pages back to the main flash home page, and not the other pages in the flash part of the website.
    I have read that in cs3 it was possible using the flashvars skip variable, but I don't know how to do it. I have not yet seen any working examples and I could not find any instructions / tutorials online for cs5.
    Can someone help here?

    add a query string, to the swf's embedding html, with variable/value indicating the frame you want to display in your swf.  add a javascript function to return the query string (or entire url), call the javascript function from flash using the externalinterface class.  and finally add code to your swf to parse the returned url or query string, parse it and then direct your timeline to the appropriate frame.

  • Controlling movieclip from main timeline & Child

    Hi,
    This code is currently contained within my "mc_1" movieclip. I want to be able to have this code on my main timeline, however no matter what I try I constantly get errors, multiple different versions. I've tried adding mc_1 infront of everything, but that just gives an output error about a Sprite.
    Also, I'm currently using visible to control whether the back image to the textbox should show - What I'd really like to do is control it using a child, but they're movieclips not buttons, so when I try to addChild within the function it errors saying I'm trying to control a movieclip within a simplebutton function.
    import flash.events.MouseEvent;
    stop();
    mc_textbox.visible = false;
    for(var i:uint=1; i<8; i++){
        this["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
        this["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in(e:MouseEvent):void // Defineing the function as line_in
        var lineTarget:SimpleButton = SimpleButton(e.currentTarget); // The variable is lineTarget
        switch(lineTarget) // Each case should swap the lineTarget
            case line1: // line 1 is the first button
            line_output.text = "1"; // This text should display
            mc_textbox.visible = true; // The textbox should display
            break; // If this is not the case, break and check next
            case line2:
            line_output.text = "2";
            mc_textbox.visible = true;
            break;
            case line3:
            line_output.text = "3";
            mc_textbox.visible = true;
            break;
            case line4:
            line_output.text = "4";
            mc_textbox.visible = true;
            break;
    /* This case has much more text than the rest, as such the textbox is enlarged for this case only
    and changed in position. The line_output dynamic text field is also moved on the Y axis for this.
    This is reset to default using the line_out function.
            case line5:
            line_output.text = "55";
            line_output.y = 427.65;
            mc_textbox.visible = true;
            mc_textbox.height = 100;
            mc_textbox.y = 417;
            break;
            case line6:
            line_output.text = "6";
            mc_textbox.visible = true;
            break;
            case line7:
            line_output.text = "7";
            mc_textbox.visible = true;
            break;
            default: // If none of the cases are true, this should display
            line_output.text = ""; // line_output should be blank
            mc_textbox.visible = false; // mc_textbox should be invisible by default
    function line_out(e:MouseEvent):void
            line_output.text = "";
            line_output.y = 474.65;
            mc_textbox.visible = false;
            mc_textbox.height = 61.95;
            mc_textbox.y = 454;

    I've resolved the timeline issue. Now my only issue is the Child not working.
    What I'm trying to do:
    addChild(mc_1.mc_textbox) to appear upon rollover of a button. On rolloff, for the child to be removed.
    Add mc_textbox inside mc_1 on rollover, at a specific XY and height. On rolloff, for the child to be removed.
    I have also been told that I should not have a dynamic textbox on the scene and should call that in using AS3 - If you have time, could you inform me how this would be done?
    Thanks alot for the help,
    ERROR:
    TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/addChild()
        at Main_new_fla::MainTimeline/line_in()
    TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/removeChild()
        at Main_new_fla::MainTimeline/line_out()
    import flash.events.MouseEvent;
    stop();
    for(var i:uint=1; i<8; i++){
        this.mc_1["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
        this.mc_1["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in(e:MouseEvent):void // Defineing the function as line_in
        var lineTarget:SimpleButton = SimpleButton(e.currentTarget); // The variable is lineTarget
        switch(lineTarget) // Each case should swap the lineTarget
            case mc_1.line1: // line 1 is the first button
            mc_1.line_output.text = "1"; // This text should display
            addChild(mc_1.mc_textbox); // The textbox should display
            break; // If this is not the case, break and check next
            case mc_1.line2:
            mc_1.line_output.text = "2";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line3:
            mc_1.line_output.text = "3";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line4:
            mc_1.line_output.text = "4";
            addChild(mc_1.mc_textbox);
            break;
    /* This case has much more text than the rest, as such the textbox is enlarged for this case only
    and changed in position. The line_output dynamic text field is also moved on the Y axis for this.
    This is reset to default using the line_out function.
            case mc_1.line5:
            mc_1.line_output.text = "55";
            mc_1.line_output.y = 427.65;
            addChild(mc_1.mc_textbox);
            mc_1.mc_textbox.height = 100;
            mc_1.mc_textbox.y = 417;
            break;
            case mc_1.line6:
            mc_1.line_output.text = "6";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line7:
            mc_1.line_output.text = "7";
            addChild(mc_1.mc_textbox);
            break;
            default: // If none of the cases are true, this should display
            mc_1.line_output.text = ""; // line_output should be blank
            addChild(mc_1.mc_textbox); // mc_textbox should be invisible by default
    // Removes any text that has been displayed from the Dynamic text box, also resetting the sizes to default.
    function line_out(e:MouseEvent):void
            mc_1.line_output.text = "";
            mc_1.line_output.y = 474.65;
            removeChild(mc_1.mc_textbox)
            mc_1.mc_textbox.height = 61.95;
            mc_1.mc_textbox.y = 454;

  • How to add button inside move clip and call it from main timeline?

    Hi,
    On the main timeline I  have a movie clip called clock_mc and playBtn
    playBtn is  placed in the center of clock_mc
    When you press playBtn clock_mc starts playing
    playBtn.addEventListener(MouseEvent.CLICK, playClock);
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    This is working fine for me.
    But I want to add replayBtn to the last frame of clock_mc and set up the function on main Timeline.
    Another words when the clock_mc rich last frame you see replayBtn.
    code example:
    replayBtn.addEventListener(MouseEvent.CLICK, playClock);
        if (event.target == replayBtn)
            clock_mc.play();
            replayBtn.visible = false;
            trace ("replay button was clicked");
    I've tryed to placed the replayBtn on the stage on the main timeline and I've set it up to replayBtn.visible = false;
    And then I add replayBtn.visible = true; to last AS frame of clock_mc but it wont work
    Even when I put the button physically to the last frame of clock_mc it will not work either.
    Please help

    I've solved the problem:-)
    I've set replayBtn.visible = false; on first frame of clock_mc
    and  replayBtn.visible = true; at the last frame
    and than as you sugested I'v add:
    clock_mc.replayBtn.addEventListener(MouseEvent.CLICK, replayClock);
    function replayClock(event:MouseEvent):void
            clock_mc.play();
            trace ("replay button was clicked");
    I couldn't see replayBtn at the firs stage because I have clockTween assosiated with clock:
    clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
    and I had replyBtn in the wrong place so when clock_mc was coming up on the stage replayBtn was on the left side of the stage :/
    Now I have to solve only one thing.
    Maybe you would have any suggestions please.
    I've set up stop(); in a first frame of clock_mc
    that when you see clock_mc sliding in it has to wait for playBtn to be clicked
    because I have two tween:
            clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
            playTween = new Tween(playBtn, "x", Regular.easeOut, -720,514, .5, true);
            playBtn.visible = true;
    so when you click on playBtn:
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    everythink is working fine except when I clik on replayBtn it play for I sec because there is stop(); on the first frame of clock_mc

  • Accessing class var from main timeline

    Hi all! Well I've been working on this for a couple of days
    now and just can't seem to get it to work right...... I'm still
    getting my feet wet with as3 and like it more and more everytime I
    use it.... almost.
    Anyways, here's where I'm running into trouble.
    Here's a dumbed down version of my project with all the other
    usless drivel excluded. Basically what I'm trying to do is declare
    a var and give it a value in my class. Then I want to be able to
    display that value on the stage and use it in the main timeline.
    Seems simple enough....
    I need to be able to pass the var from the class to the main
    timeline for use.... Any help on this would be GREATLY appreciated.
    Thanks.

    kglad, worked like a charm in my short test file... however
    in my real world flash file the class takes a short time to
    actually compute the value of the variable. If I fire the trace
    from the main timeline it will display NaN b/c at the moment it
    fires the value of the var doesn't exist b/c it has yet to be
    calculated......
    I don't really know the best way to delay this... would the
    best way be to somehow add an event listener to listen to the var
    to see when it is assigned a value?.... I'm open to suggestions.
    btw, good catch on the assignment of a string value!!
    Thanks!

  • Controlling multiple external swfs from main timeline

    Hi, I've been trying to combine the features of two tutorials I found, one that deals with controlling external swf's from the main timeline and the other that explains how to load and unload multiple external swf's.  I'd like to be able to load and unload multiple external swf's, and control these swf's buttons from the main timeline. 
    I asked this same question on the forum of the site where I found these tutorials, and receive only one reply saying that "it should'nt be hard to do." but they did not elaborate any further.  This left me think that I was missing something very obvious and I've spent too much time now trying to work what it is now.  I understand pretty much how both pieces of code work, but just can't work out how to combine them.
    If someone could explain it to me, I'd much appreciate it.
    Tutorial One code - controlling an external swf from the main timeline.
    var ldr:Loader = new Loader();
    var urlReq:URLRequest = new URLRequest("swfs/balls.swf");
    ldr.load(urlReq);
    function loadHandler (event:Event) {
    var myClip:MovieClip = event.target.content;
    addChild(myClip);
    function myClipOver(event:MouseEvent):void {
    myClip.myBlueBalls.stop();
    function myClipOut(event:MouseEvent):void {
    myClip.myBlueBalls.play();
    // set listeners
    myClip.addEventListener(MouseEvent.ROLL_OVER, myClipOver);
    myClip.addEventListener(MouseEvent.ROLL_OUT, myClipOut);
    // listener
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
    Tutorial Two code - loading and unloading multiple external swfs.
    var Xpos:Number = 110;
    var Ypos:Number = 180;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
    // Btns Universal function
    function btnClick(event:MouseEvent):void {
    removeChild(loader);
    var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
    loader.load(newSWFRequest);
    loader.x = Xpos;
        loader.y = Ypos;
    addChild(loader);
    // Btn listeners
    eyesClosed.addEventListener(MouseEvent.CLICK, btnClick);
    stingray.addEventListener(MouseEvent.CLICK, btnClick);
    demon.addEventListener(MouseEvent.CLICK, btnClick);
    strongman.addEventListener(MouseEvent.CLICK, btnClick);

    I will not be able to help you with whatever relaxatraja provided though it is purported by relaxatraja to be clearly explaining what I was explaining (???).
    Your loadHandler function appears a bit confused.  For the code you show I don't see you assigning any event listeners for the events that will be dispatched in the loaded file.  As I showed earlier, your loadHandler function should be assigning a listener for the event that will be dispatched (modified slightly below). and if you have three different events being dispatched in the loaded file, then you'll do better to have three different listeners.  I show only one below for one of the events you dispatch...
    function loadHandler (event:Event) {
      // assign a listener for the loaded file's goExit function's event
       MovieClip(event.currentTarget.content).addEventListener("close", event1Handler);
    // I can't make sense of what you have here
        removeChild(myClip); // why ?? - it hasn't been added yet as far as I can see - error 2007?
        var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf"); // the event.target is the Loader
        ldr.load(newSWFRequest); // this will load over the file you just finished loading??
        ldr.x = Xpos;
        ldr.y = Ypos;
        addChild(myClip);  // why?? it has nothing in it
    function event1Handler(e:Event):void {
        // do whatever is involved with what the "close" event is supposed to do
        trace("goExit function executed");
    As far as what you have in the loaded file, you appear to be trying to pass the files names as if they were parameters.  The file naming should be done at the receiving side for the event handler function for the event listener.  While you could create a custom event that include parameters that you can pass, that's another level of coding that is better left for a future experience.
    Study the following - understand it before you try to use it.
    Below is a link to some files I made for another posting that demonstrates what I have been explaining.  The neurope file is the main file.  Publish the netherlands file so that you have an swf to load for it, and then run the neurope file.  The file that gets loaded (netherlands) only has a button in it that when clicked dispatches an event for which the main file (neurope) has assigned a listener.  The main file displays a message when the button gets clicked in the loaded file.
    http://www.nedwebs.com/Flash/neurope.zip

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

  • Help me Create gotoAndPlay from Main Timeline to a MovieClip frame

    Sounds stupid, but I'm barely stepping up from AS 1.0, and
    3.0 is super cool, but also making my head spin. I'm knee deep in
    learning C# and AS 2.0 as it is, as well as working in VS 2005 for
    the first time, and I'm working very hard to get all of my asp.NET
    software to be running data driven Flash AS 3.0 UIs.
    So this stupid noob question when answered, is going to help
    a ton, and I've searched for hours so far, and finally resorted to
    just tuckin the tail and asking for help. HELP! :) Thanks,
    Chris

    Hi, you can set an instance name( for example mcClip ). Then
    you can access everything in this clip ( including gotoAndPlay
    using dot: mcClip.gotoAndPlay

  • Flash CS6 requires trace from main timeline to embed flex assets

    I've been repeatedly advised on twitter by the @CreativeCloud account to make a thread on this subject.
    This only occurs with large projects that use a lot of memory. I have tried to recreate the problem with the minimum amount of code but it is not possible. This issue does not occur with only the flex.swc, a class file and a .fla project. Changing the value in jvm.ini makes no difference. Importing other swcs makes no difference. Please re-read this line before responding.
    The issue: If I include flex.swc to use the [Embed] tag feature in a class file with Flash CS6, the feature will silently fail. The assets will return the value of null.This issue has existed since Flash CS5 dropped support for flex and has caused our company to lose hundreds of hours in programming workarounds for the problem. We are exceptionally disappointed in Adobe for encouraging use of [Embed] tags and then leaving us with scores of broken projects that cannot be compiled in the latest version of the Flash IDE.
    However: this week I discovered that the problem disappears if I import the class on the timeline and trace() the value of any asset in the class. Importing the class is not the part that solves the problem. If I have the "omit trace" checkbox ticked, the assets still return null. It is only when the assets are fed to trace() that they begin to exist.
    Think this through for a second.
    The workaround for a critical bug in Flash is solved by trace(). "Hello World!" is the solution to the Flash IDE's ongoing mismanagement of memory.
    I can't even begin to wrap my head around how stupid this situation is. Or even how much money has been lost trying to deal with the situation.
    I don't even expect a workaround or solution in response to this because we already have a workaround - even though it is insane.

    I've been repeatedly advised on twitter by the @CreativeCloud account to make a thread on this subject.
    This only occurs with large projects that use a lot of memory. I have tried to recreate the problem with the minimum amount of code but it is not possible. This issue does not occur with only the flex.swc, a class file and a .fla project. Changing the value in jvm.ini makes no difference. Importing other swcs makes no difference. Please re-read this line before responding.
    The issue: If I include flex.swc to use the [Embed] tag feature in a class file with Flash CS6, the feature will silently fail. The assets will return the value of null.This issue has existed since Flash CS5 dropped support for flex and has caused our company to lose hundreds of hours in programming workarounds for the problem. We are exceptionally disappointed in Adobe for encouraging use of [Embed] tags and then leaving us with scores of broken projects that cannot be compiled in the latest version of the Flash IDE.
    However: this week I discovered that the problem disappears if I import the class on the timeline and trace() the value of any asset in the class. Importing the class is not the part that solves the problem. If I have the "omit trace" checkbox ticked, the assets still return null. It is only when the assets are fed to trace() that they begin to exist.
    Think this through for a second.
    The workaround for a critical bug in Flash is solved by trace(). "Hello World!" is the solution to the Flash IDE's ongoing mismanagement of memory.
    I can't even begin to wrap my head around how stupid this situation is. Or even how much money has been lost trying to deal with the situation.
    I don't even expect a workaround or solution in response to this because we already have a workaround - even though it is insane.

  • Execute functions in document class when main timeline reaches a frame

    Hi,
    I have 3 functions in my main document class that I want to execute when the main timeline reaches a particular frame number.
    how do I do that?
    see the code and comments
    public function mainClass()
    //stage declaraction
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.addEventListener(Event.RESIZE, stageResized);
    //wrap these next 3 lines in an if statement that says if maintimeline currentframe = x
    position();
    loadXml();
    initArrowButtons();
    slideTimer = new Timer(timer_delay);
    slideTimer.addEventListener(TimerEvent.TIMER, nextSlide);

    It's still undocumented, but something like this would do it:
    package
        import flash.display.MovieClip;
        public class FrameScript extends MovieClip
            public function FrameScript()
                addFrameScript( 3, frameFour );
            private function frameFour():void
                trace( "you have reached Frame 4" );
    You can test this as a documentclass.

  • How to target button in movieclip back to main timeline

    Hello!
    I have some submenu buttons in a movieclip on the mainline. My first level of navigation in on main timeline. The submenus are grouped in movieclips on the main timeline. I basically used the same code on the main navigation for the sub navigation except the code for the submenus is in that movie clip. My trace statement reads the button is clicked (which was a quantum leap for me) but I know I need some kind of _parent code in there so it knows to go to label back on main timeline. Can anyone help?? I feel like I am so close.
    Also is this an ok way to set this up? I couldn't figure out how to do it in one frame. Any help would be so appreciated. I didn't realize this basic framework was going to be so difficult.
    Here is link:
    http://www.sandraschmitt.com/coclico/index2.html
    Thanks!!
    Sandra
    Here is my code that is on the submenu movieclip:
    Code:
    stop();
    fall.addEventListener(MouseEvent.CLICK, clickSection);
    spring.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
         //trace shows what's happening... in the output window
         trace ("The "+evtObj.target.name+" button was clicked!")
         //go to the section clicked on...
         gotoAndStop(evtObj.target.name);

    One reason I'll never win any awards for my design outlook is because I often follow... if it works, use it.  There are many ways to approach a design and yours is just fine if you understand it.  If it was going to crash something, it would have happened by now.  Some people will go to the extreme of having absolutely no code in a file, some even no library content, writing it all into class files, and not out of necessity, but out of simply believing it's the better way, or a challenge to prove their abilities...  They can have it.  There is a practicality involved with design that allows one to make judgement calls, and if you judge that your design approach is practical for what you understand or for what meets the needs of the project, then you have every right to follow your own path.
    That said... in the event someone should inherit your work somewhere down the road, that's when your approach may fall victim to judgement... if someone cannot follow it or is having trouble putting all the pieces together, or finding them, then you become the fall-person for the whining that ensues.  But you're not likely to have to hear about it.  Still, someday, if you find yourself in a position where you inherit someone's design... and you start whining about how they did it, you'll come to appreciate the reasons for giving consideration to how you approach your designs.

Maybe you are looking for

  • What is it about data types of local variables?

    Hey there! I'm trying hard to access the booleans, whose refnums got stored into an array. As the example show, everything's fine unless I start using local variables: I can access the data in the topmost FOR loop. As soon as variables come into play

  • BAPI to add Customer's Contact Mobile Number

    Hello, I have to create a badi in which i have to create a business partner with details such as name, address ,telephone ,fax ,mobile number. I got bapi for everything except for mobile number. Please let me knw which bapi or functional module which

  • Fiori : Mass Approval

    Hi, Is Mass Approval possible for Approval apps in Fiori ? I see we have Mass Action field in Scenario definition . If i check it, how can we enable Mass approval in Fiori ? Any other solution, please highlight

  • Accessing Oragnization management tables

    Hello All, Could anyone tell me how to access Oragnisation Management HRPNNN Table in infotype Module pool Include. What are the Pre requisite,Do i need to make some configuration Thanks & Regards Sonu Gupta

  • DVD Studio Pro 2.05 Crashes on Tiger (10.4.11)

    Is DVD Studio Pro 2.05 compatible with Tiger (10.4.11)? DSP-2.05 crashes when reopening a project or when running the Simulator. Sy B