slider to control the main timeline

What code should I take the slider and do control the main timeline? I created a presentation with audio integrated and images coming and to tell the person. I need a way to scrub back to the bottom of the timeline.

Try the following, where sl is the instance of cursor...

function moveAlong(evt:Event):void {}
gotoAndStop (sl.value);
}

SL.minimum = 1;
SL.maximum = this.totalFrames;
sl.liveDragging = true;
sl.addEventListener (Event.CHANGE, moveAlong);

Tags: Adobe Animate

Similar Questions

  • Toolbox for CreateJS: how to control the main timeline from outside the canvas.

    Hey everybody,

    I'm currently doing something simple, but my animation film breaks whenever I try to change my code. I created a basic animation in Flash where an object moves from the left side of the canvas, to the right and then loops of the last frame of the first image. Nothing else. The animation is simply placed on the main timeline. I exported the animation with the Toolbox for CreateJS through the extension of the Flash and animation series as it should. I'm trying to start and stop (reboot of the first image) the animation with the mouse on and off mouse events. I want that the events to fire when wriggling over/stop a div outside the animation canvas tag. Is this possible with CreateJS? I'm trying to find a way to control the main timeline without being inside the canvas tag.

    HTML example:

    http://www.thephotoncore.com/testing/example_test.html

    Example Code:

    < id article 'container' = >

    < canvas id = "canvas" width = "550" height = "400" style = "background-color: #cccccc" > < / canvas >

    < section id = "animation_control" >

    < p > hover over to start and stop animation. < /p >

    < / section >

    < / section >

    Thanks again for the help!

    -DJ

    Hi DjPhantasy5,

    All the clips on the scene are children of the scene,

    So now the "mouseover" all clips on the stage could be stopped with stop and on the "mouseout/mouseouthandler()" all the children could be restarted with gotoAndPlay like this:

    function Stop()

    {

    If (stage & stage.children)

    {

    var t = stage.children.length;

    for (i = 0; i< l;="">

    {

    child var = stage.children [i];

    If ('stop' in child)

    Child.Stop ();

    }

    }

    }

    function Restart()

    {

    If (stage & stage.children)

    {

    var t = stage.children.length;

    for (i = 0; i< l;="">

    {

    child var = stage.children [i];

    If ("gotoAndPlay" children)

    child.gotoAndPlay (0);

    }

    }

    }

    See http://www.liauw.nl/forums/adobe/djfantasy5/index.html

    But it is also possible to expose "ball1", for example, by adding it to the document.

    This can be done by adding the code for "ball1" as follows:

    / * js

    document.ball1 = this;

    */

    Then stop the animation would look like:

    function Stop()

    {

    If ('ball1' in the document)

    document.ball1.stop ();

    }

    etc.

    Have fun!

    Ronald

  • Control the main timeline and chronology of built-in movie clip

    Good afternoon folks,

    I am trying to solve this problem.  I have a main scenario with an animation. (animation is not a clip).  I also have a clip film embedded in the main timeline. I want to control the actions of the main timeline AND the embedded animation at the same time.

    For example, when a user clicks on a button "pause", I want to stop the animation of the main timeline as well as the integrated clip. I figured out how to stop the main timeline using the stop(); command.  I also understood how to stop the film incorporated using the command _root.embeddedclipinstancename.stop ();  Problem is that I don't know the commands to stop the two things at the same time.

    I tried to find that an instance name for the main timeline, but there is no (I think). I know I could do the animation in the timeline in a clip, but I don't want to go that route.  Any ideas on how to control two things?
    Also, if possible, I would prefer not to use the _root command since I know that this can cause a conflict in Captivate.

    Thank you.

    Include the two commands that worked in your pause button code.  If your [ause button is on the main timeline, you don't need to use a reference of _root.  It is only really useful if you target some of child level object distance back to the main timeline.  You can _parent (and string them if necessary) instead of using _root.  As you will get in trouble unless you're on the _root timeline when using it.

  • Control the main timeline of a movie via a button in a movie on another level.

    Hello!
    I have two film is at two different levels.
    Level 5 is my base film and I load another movie on top of that in level 10.
    Once the user clicks on a button in the movie to level 10, I would like to animation to level 5 to stop (the animation runs on the chronology of the main root of level 5).

    Once the user clicks a different button in the movie to level 10, I would like the animation in the main timeline of the movie in level 5 again from the moment it was already stopped.
    Is this possible?

    It would be great if someone could help me with this.
    Thank you, midi_ie

    You can't delete this loop of onClipEvent (enterFrame) unless you remove the movieclip to which it is attached. However, you can add an else if statement in your code (in addition to checking the variable Boolean "drag") to check if your _level10 button has been activated.

    and you can delete a slider.onEnterFrame loop, but you probably don't want to do.

    p.s. make the loop enterFrame?

  • Button inside a clip controlling the main timeline

    Hello-

    I have a clip on the main stage - inside that movie clip is a button - I want that button to contol a function on the main timeline.

    example: the Script button

    closeAll_btn.addEventListener (MouseEvent.MOUSE_DOWN, goCloseAll);

    function goCloseAll(e:MouseEvent):void {}


    * do not know what to put here to activate "closeAllOpenMovieClips" on the main stage *


    }

    example: main stadium Timeline Script

    function closeAllOpenMovieClips (): void {}
    trek_mc.gotoAndStop (1);
    lost_arts_mc.gotoAndStop (1);
    rain_mc.gotoAndStop (1);
    vintage_mc.gotoAndStop (1);
    }


    do not know if I need a script more on chronology of main stadium that comes "from function."

    Thank you - Ben L

    If the button is in part 2, then the event listener so that it must be well on frame 2... or you could make the button visible/invisible betrween frames 1 and 2).

    But if you want to head back to your original approach...

    closeAll_btn.addEventListener (MouseEvent.MOUSE_DOWN, goCloseAll);

    function goCloseAll(e:MouseEvent):void {}

    MovieClip (root) .closeAllOpenMovieClips ();

    }

  • How to control the main timeline of buttons in a movieclip - jobs in peril!

    I'm doing something simple in theory. In my main script, I have a series of images with labels for each image. In a movieclip (with its own labels and script) under the images, I have two panels of butttons flop back and forth (to save space). The idea is to have the script simply main plays the frame specified by the corresponding button in the movieclip. I tried the parent.child thing, but im hurt, or is not the solution. If anyone can help me I will be saved from certain death. If you think that any other part of my project can be blamed, ill be happy to provide you with anything that can help. Thanks in advance.

    Here is my script:

    ActionScript code:
    function on1click(evt:MouseEvent):void {     gotoAndPlay("pic1"); } thumbPanel.pic1_btn.addEventListener(MouseEvent.CLICK, on1click);

    This is the error:

    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at gallery_fla::MainTimeline/frame1()

    1009 error indicates that one of the objects targeted by your code are out of reach.  This may mean that the object...

    n ' is not in the display list
    n ' is not have an instance name (or the name of the instance is misspelled)
    n ' is not in the frame where this code tries to talk to her
    -is animated in place, but is not assigned the name of the instances of each keyframe for her
    -is one of the two or more consecutive keyframes of the same objects without a name assigned in the image previous (s).
     
    If you go to your section to publish the Flash settings and select permit debugging option, your error message should have a suite of line number the number of the frame that will help you to isolate the object that is involved.

  • Control the main storyline of the film loaded

    I loaded an external film on the main movie in a movie clip called "mainholder" - in the main storyline on the main sequence there is a command to 'stop' on frame 1. The film loaded, I want to control the main timeline and tell him to go to frame 2. Can someone tell me the actionscripting to do this, I have tried several commands and frustrated. ;-)

    Thank you

    OK... _ is necessary to _parent and _root... all other instance names are called by their name on the timeline then... in the case of this file, try this

    {We (Release)}
    unloadMovie (this._parent.loadsgPhotosMain);
    }

  • Control loaded swf on the main timeline

    Hello

    I'm working on loading external swf files for ios. I am able to load swf files and assembled visible or invisible in different settings. I have trouble controlling the swf files loaded on the main timeline. Specifically, I would like to have a button on the main timeline, that when you click on will move a swf loaded to frame 1.

    Here is a code that loads a swf file:

    var myLoader1:Loader;

    var loaderContext1:LoaderContext = new LoaderContext (false null, ApplicationDomain.currentDomain),

    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, in the file1.swf I click a next button to move on to different periods.) My question is: hHow do I code the "backbutton" on the main timeline so that it causes the file1.swf to go to frame 1?)

    Thank you for your help.

    After loading is complete (and assuming that you load an as3 swf), you can use:

    MovieClip (myLoader1.content) .gotoAndStop (1);

  • Button on the main timeline control movieclip

    Hello

    I have a stop in my main script. At the stop, I have a play of movieclip. In the movieclip, I'll have a video playback. After playing the video, I have a button for the user to continue playing until the end of the movieclip. Once the movieclip is done, I want back the return to a specific image in my main script.

    I can't figure out how to make this work. Anyone have any ideas?

    Thanks in advance,

    Paul

    How much of what you just described in currently working properly?

    If it's just the last step to have the game finished main scenario the movieclip, then you might have an event listener assigned to this movieclip in the main timeline.  When the movieclip ends it can send an event of this listener that can trigger an event handler function in the main timeline to tell the main scenario for continued as planned.

    Another less glamorous but more compact approach might be to have a drive inside / at the end of the movieclip to order the main scenario of an act using something like...

    MovieClip (parent) .gotoAndPlay (whatever);

  • Movie Clip on the main timeline to control

    I have a button in a mc and I want that he plays on the main timeline, it does, however, when it gets to the last specified image I want to go to another frame.
    Here's my actionscript I was that day.
    on (release) {}
    _root.gotoAndPlay (75);
    }
    Basically I want all my buttons to play 75 weft, however after each button corresponds to a different image that I need to go to play. 75 frame is essentially a transition to other pages. Each page has the same transition. Any ideas on how to achieve this?

    Well, I have a layer called actionscript, which is for my codes. Where you found other ActionScript where I don't know. But thanks for all your help. Whatever it is, problem solved.

  • Targeting the main timeline of in a MC

    Hello all, I have this project that basically works like a slide show. I'm doing things common sense and avoid scenes so I am building each slide as a separate and then mc placing them on the main timeline. What I'm trying to do is get the playhead to move forward on the main timeline to the next image once the mc reached its last picture. I found code that works, but it looks pretty ghetto:

    var _root:MovieClip = MovieClip (root)

    stage.addEventListener (Event.ENTER_FRAME, Text2);
    function Text2 (myevent:Event): void {}
    _root.gotoAndStop ("slide2");
    }

    I guess I have two questions:

    1. What is the right way to target a frame on the main timeline of in a mc in as3?

    2. the way I do build does make sense, or is there a better solution?

    Thanks for reading!

    This code is an accident waiting to happen.  An ENTER_FRAME event is raised repeatedly, at the rate of the file.  This does not mean that it looks like... such As... When something enters a ' framework' everything you need instead of this code is to put the following line in the last image of the mc...

    MovieClip (root) .gotoAndStop ("slide2");

    Since you asked on 'clean'... children should not talk back to their parents and tell them what to do.  The good news is that they should be independent and care only for doing what they do. It is the parent to keep an eye on the kids if they are so trend.  The only thing they should do is to know when they are made to the world the fact.  This is done by sending an event.

    If what you're doing are implemented the child to dispatch an event to indicate that they are doing what they are doing (in the last image in your case).

    dispatchEvent (new Event ("imDone"));

    and set up a listener for this child object in the parent of the parent timeline to listen to this event...

    childName.addEventListener ("imDone", eventHandler);

    function eventHandler(event:Event):void {}
    gotoAndStop ("slide2");
    }

  • Controls the main scenario for swf loaded.

    Hello

    I use a textfield for debug information.

    I am loading a swf in the main timeline and I show the status in the textfield of debugging.

    function swfLoaderCompleteHandler(event:Event)

    {

    Debug.Text += "Swf loaded.";

    }

    This works.

    But,

    I am loading a png file in the loaded swf file. I'm showing the State of the png file that I showed the status of the swf file.

    function pngLoaderCompleteHandler(event:Event)

    {

    MovieClip (parent). Debug.Text += "Png loaded.";

    }

    I can't control the main swf from inside the loaded swf file. Same Stop or a function call does not work.

    I need to add something when I load the swf file, it's a MovieClip or something?

    Here is also a fla. http://flashfocus.nl/Forum/attachment.php?attachmentid=9885 & d = 1282509233

    You are welcome.

    Please mark this thread as answered, if you can.

  • Targeting of evil to a button on the main timeline for a VideoEventComplete at work

    I have a .fla file that has buttons on the main timeline that target frames in a mc named 'pages' in a table.  The 'pages' are implemented in the form of frames each five images or as a slide show where the buttons advance or return to the previous page.  I want to make invisible buttons until frame 30 video is complete (page 4).  When I insert the code below in the main timeline, the button becomes invisible, but there is no event that will finish to come back only to show the button so it sits right there with no way to advance as the buton is invisible,

    Then... How to target the button to only be invisible when it has an event video complete but not not start before 30 (page 4) image of the mc and then do it again in the 35 framework etc.

    I tried to put it in the main timeline and on the frame of the first video.  If I'm on it within the pages don't need to point the code on the main timeline to get code know where are the buttons? Something like main_timeline.nextbtn etc... ?

    The code in the settings:

    Stop()

    Import fl.video.VideoEvent;

    THIS BUTTON IS LOCATED IN THE MAINTIMELINE\\
    nextBtn.visible = false;
    addEventListener (VideoEvent.COMPLETE, doNextFrame);

    function doNextFrame(e:VideoEvent):void {}
    nextBtn.visible = true;

    pages.nextFrame)
    }

    All the code is:

    THE CODE of the MAIN SCENARIO is:

    Listeners of button

    import of flash.media.SoundMixer;// it comes to the


    nextBtn.addEventListener (MouseEvent.CLICK, nextSection);
    prevBtn.addEventListener (MouseEvent.CLICK, prevSection);

    ///////////////////////////////////////////////////////////////////////////

    function nextSection(event:MouseEvent):void {}

    var thisLabel:String = pages.currentLabel; Gets the current image under chain tag
    var thisLabelNum:String = thisLabel.replace ("sct", ""); cut the main letters off the number
    var curNumber:Number = Number (thisLabelNum); Converts this string to a real number number
    If (curNumber < 18)

    {

    var nextNum:Number = curNumber + 1;
    pages.gotoAndStop ("sct" + nextNum);

    }

    SoundMixer.stopAll (); Place it inside your functions

    }
    ///////////////////////////////////////////////////////////////////////////
    function prevSection(event:MouseEvent):void {}

    var thisLabel:String = pages.currentLabel; Gets the current image under chain tag
    var thisLabelNum:String = thisLabel.replace ("sct", ""); cut the main letters off the number
    var curNumber:Number = Number (thisLabelNum); Converts this string to a real number number
    var prevNum:Number = curNumber - 1; subtract 1 from the number, so we can go to the next image tag
    pages.gotoAndStop ("sct" + prevNum); This allows us to go to the previous image tag

    SoundMixer.stopAll (); Place it inside your functions


    }

    Please Note: it started in a previous discussion, but I think that I was confused that the question so go fresh here, thank you so much for the time on this

    I can't say I'm immune to be confused by the story you tell, but I'll take a stab to offer what could be a solution.  If the buttons are in the main scenario and the code that you want to make visible with in a movieclip which lives on the main timeline, then you can target the buttons from inside and using movie...

    MovieClip (parent).nextBtn.visible = true;

    MovieClip (parent).prevBtn.visible = true;

  • embedded symbol communicate with the main timeline.

    Hi all

    I create a survey with say 7 questions.  each question has the same MovieClip symbol each with a different instance name, as q1, q2,... q7.

    the MovieClip symbol has 5 texts static and 5 SimpleButtons.  I have a code in the symbol to ensure that only one button has the 'on' or 'verified' status to show that this one is chosen.  It works very well.

    My question is, how to communicate the choice of each user with the main timeline after the user clicks on the button "submit"?  or, how can I get the code in the mousedown event 'submit' that can iterate through the 7 symbols to interview each of them and see which of the 5 SimpleButtons is 'controlled' or 'on '.  this iteration then creates a list of answers to questions 7.

    in the end, I'll have flash concatenate a string GET POST that will send the results of the survey on a web server.

    I am using / learning AS3 in flash cs4 and I know I'm a bit new to these concepts.  Thank you in advance and if you could point me to a video tutorial that will support your advice, it would be useful also.  Happy new year.

    assign a variable (say checkedBtn) that stores a value indicating which button is checked in each or your 7 movieclips.

    so if all 7 movieclips are at the point where you click on the submit button you can browse your 7 movieclips using:

    for (var i: uint = 1; i<>

    This ["q" + i] .checkedbtn attribute this to your url variables or create your concatenated string

    }

  • CLICK in the main timeline &gt; &gt; will click where is designated in loaded swf?

    Seems doable, but difficult to grasp the concept...

    I have a slideshow loaded swf in this slide show, I assigned "next" and "prev" buttons to promote and save my slide show via the image labels ("avowed") for example... Here is an example:

    btn_next.addEventListener (MouseEvent.CLICK, nextClick);

    function nextClick (e:MouseEvent): void {}
    this.gotoAndPlay ("twoIn");
    }

    I want this function to execute when I click a State hit on the main timeline above him. So, how I would trigger the function above with a click on the State of success in the main timeline?

    To help, here is my code for the mouse over the function using the State of success that refers to the external buttons:

    pNextH.addEventListener (MouseEvent.MOUSE_OVER, nextOver);

    function nextOver (e:MouseEvent): void {}
    var mc:MovieClip = MovieClip (imageLoader.content);
    MC.btn_next.gotoAndPlay ("nextOver");
    }

    Code of THS I gave calls the nextClick() function that is defined in the main timeline of your loaded swf file, assuming nextClick() is in the main timeline and yourloader is the reference of your charger.

Maybe you are looking for