Reversing a symbols timeline

Hi there,
I need to activate a timeline event on a symbol with a button press on another object, then when the button is pressed again, reverse the timeline event. This will have something sliding in and out of the stage.
If the animation is placed right at 0.00 and there's nothing else, then this code works OK:
if (sym.getPosition() == 0)
    sym.play();
else
    sym.playReverse();
However there is other animation that plays automatically on page load, then a trigger stops all animation. The animation I need to trigger is a couple of seconds later bracketed by labels 'start' and 'stop'. So I need to code the button A to get the symbol B and animate from 'start' to 'stop' and then wait. Then on a further press to animate from 'stop' to 'start'. But I'm damned if I can get anything to work.
Any ideas, anyone?

Hi Salieri_purple,
Let's define a growingUp symbol with autoplay property set to true which grows up a rectangle from bottom to top of the stage in 5s.
In Stage > document.compositionReady event handler, let's define a JavaScript object containing
• a boolean property reverse initialized to false ;
• a function to switch the direction based on the direction and the current cursor x value e.pageX (e is the event object passed as a parameter ; stage width : 400) :
ANIMA =
  reverse: false,
  switchDirection: function( e)
    var symAnima = sym.getSymbol('growingUp');
    if (ANIMA.reverse && e.pageX <200)
      symAnima.play();
      ANIMA.reverse = false;
    else if (!ANIMA.reverse && e.pageX >200)
      symAnima.playReverse();
      ANIMA.reverse = true;   
Stage > mousemove event handler
ANIMA.switchDirection( e);
The example file is downloadable here : https://app.box.com/s/ivqjhao17m4jbg4ldf9q
Gil

Similar Messages

  • Reversing a symbol from end of timeline?

    Hi everyone,
    Just recently started using adobe Edge and im loving it!
    I have a symbol which i would like to control via swipes left and right. Swiping left will play the symbols timeline forward and then swiping right I want the symbols timeline to play in reverse (so from the end of its timeline backward). So for example the symbol will obviously start from time 0, swiping left would simply play the timeline from 0 onwards, but swiping right i want it to play from the end of its timeline backwards.
    I have obviously figured out how to apply swipe actions but I cannot figure out the easiest way to reverse the symbols timeline!
    Thanks for any help!

    Hey,
    Thanks for the response. I tried the sym.playReverse() and it does play backwards! This is all good BUT in my symbols timeline there is 3 stops. So when I reverse the timeline from the beginning of the timeline the symbol will play in reverse but when it gets to the first stop it will skip a frame and go 1 frame too far back?? Its soo frustrating!
    Please has anyone got an idea why this is happening? Its destroying my whole project!
    Thanks

  • Two symbols, have same code, yet one behaves erratic.  Both stage and symbol timelines used.

    Here is a link to the problem site using edge: http://pbpromos.com/test-edge/
    Basically, there is a random or erratic behaviour with the symbol/box on the right when you go into and out of it by pressing the button on the bottom which makes it scale out and in.  The symbol/box on the left always behaves like it should no matter how many times you press the bottom button scaling it out/in.  However, for the symbol/box on the right, it skips animation steps at random times by pressing the bottom buttons.  When you first load the page, the right symbol/box scales out/in properly and may take a few times to reproduce the problem.  Sometimes you have to try also going in and out of the symbol on the left and then try the symbol on the right to make it show this erratic behavior.
    MORE DETAIL:
    The symbol all the way to the right ( Merchant Dashboard ) is not behaving like the one on the left.  When you go into them with the bottom button, the symbol scales out towards you making it bigger and pushes the symbol on the left out.  When you press on the RETURN button on the bottom it should scale back by playing the animation in REVERSE.  It does this by playing the stage and symbol timelines in reverse all the way to the start of their respective timelines.  This works fine for the right symbol if you try going in and out several times, however, the right symbol behaves eratically when trying to go in and out multiple times.  Yet they both have identical code.
    If you try going in and out you will see what I mean.
    There are three timelines.  The stage timeline and the two symbol timelines.  To scale out when you press the bottom red button, I play the stage timeline and the symbol's timeline.  Here is the code at the stage level triggered by the buttons which are found inside the two symbols:
    Right button (CLICK): "DASHBOARD LOGIN"
    sym.play("Dashboard");   // Label at the symbol timeline
    sym.getComposition().getStage().play("Dashboard");   // Label on the stage timeline
    Left button (CLICK): "REDEEM VOUCHER"
    sym.play("RedeemVoucher");   // Label at the symbol timeline
    sym.getComposition().getStage().play("RedeemVoucher");   // Label on the stage timeline
    When the stop(); is reached and the symbols scale out, I display the "RETURN TO MERCHANT AREA" button.  When this is clicked this code is executed within the symbols:
    sym.playReverse();
    sym.getComposition().getStage().playReverse();
    Any thoughts would be appreciated.
    Here is the link to oam file: https://www.dropbox.com/s/r33fu86779012yn/Adobe-Edge-Test-1.oam

    ok, I stand before you, head bowed in humiliation, begging for your forgiveness :-)
    I'm not sure what is going on but I found the font problem (or at least it seems so).
    Somehow (and I don't know how but I think I've been "duplicating the same folder content each time I start a new page to test and make changes (since the problem, I have been scared to touch anything that WAS working).
    Well, it seems that the "duplicated" folder was missing my "CSS" folder in every one!
    That explains why, even though the fonts and all the settings in Edge showed everything as being correct - they were; all except the CSS page that loaded the fonts!!!
    Again, I humbly apologize - I really do try and find the problem BEFORE posting here; this one just eluded me :-)
    James

  • How do I play a symbol timeline from the main timeline

    Ive created a box, turned it into a symbol called box,
    Inside box i have a left to right animation with auto play turned off.
    I then went back to the main stage, clicked the box, added action, on click to play, yet it does nothing.
    How do i Play the symbols timeline?

    On click handler for the symbol use
    sym.getComposition().getStage().getSymbol("nameofsymbol").play();
    or
    sym.getSymbol("nameofsymbol").play();
    replace the italics with the literal name of the symbol as it appears in the Elements panel.
    Some API details found here (http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html) in the Work With Symbols section.
    Darrell

  • Checking for an updated variable value in symbol timeline

    I'm making a puzzle which involves moving crates in a specific order to get a character from one side to the other. Take a look at http://tinyurl.com/c4vwcj9 to get the gist of it.
    Each crate is a symbol with it's own timeline. A crate may only move a pre-determined direction and distance once clicked. No more than 2 crates can be pulled out of the grid at any one time.
    The timeline of each symbol has three states: "Original", "Moved" and "Returned".
    If you have a play around with the puzzle as it stands so far, you will see most of the logic arguments work ok. However, the problem I have is when you pull a crate out of the grid and it needs to check if it can move back into place.
    To see what I mean:
    - Pull out the bottom left corner crate
    - Move the crate to the immediate right, thereby blocking the previous crate
    - Try to move the bottom left corner crate again (you should get an error message and it shouldn't move - this is fine)
    - Move the other crate back to it's original position to unblock the previous crate
    - Try to move the bottom left corner crate a final time (you still get the error message and it doesn't move - this is not fine!)
    A quick debug has revealed the second mouse click doesn't fetch the updated variable AFTER the symbol timeline begins to play, but the same methodology works just fine for crates that check for impeded movement BEFORE a symbol timeline is played (try one of the inner crates). Why isn't it getting the updated value and what can I do to solve it?
    Below is a sample of the code specific to the bottom left crate. I've highlighted the variable and arguments specific to the problem. Please excuse what is no doubt poor Javascript coding conventions - I only started learning this last week!
    //-- Get needed variables
    // Check to see if other crate is impeding movement and define value as a variable
    var myCrateCheck = sym.getComposition().getStage().getSymbol("_b_2x1crate_h").getVariable("Crate2");
    // Check to see what this crate's status is and define value as a variable
    var mySelfCheck = sym.getComposition().getStage().getSymbol("_bl_3x1crate_h").getVariable("Crate1");
    // Check to see if other crates have been moved out of the main grid. Parse value as an integer in base 10.
    var myGridCheck1 = parseInt(sym.getComposition().getStage().getSymbol("_br_2x1crate_v").getVariable("Crate3_ grid"),10);
    var myGridCheck2 = parseInt(sym.getComposition().getStage().getSymbol("_bl_4x1crate").getVariable("Crate4_gr id"),10);
    var myGridCheck3 = parseInt(sym.getComposition().getStage().getSymbol("_bl_2x2crate").getVariable("Crate5_gr id"),10);
    var myGridCheck4 = parseInt(sym.getComposition().getStage().getSymbol("_cl_2x1crate_h").getVariable("Crate9_ grid"),10);
    var myGridCheck5 = parseInt(sym.getComposition().getStage().getSymbol("_cl_1x1crate_1").getVariable("Crate13 _grid"),10);
    var myGridCheck6 = parseInt(sym.getComposition().getStage().getSymbol("_cr_3x1crate_h").getVariable("Crate16 _grid"),10);
    var myGridCheck7 = parseInt(sym.getComposition().getStage().getSymbol("_tl_2x1crate_h").getVariable("Crate17 _grid"),10);
    var myGridCheck8 = parseInt(sym.getComposition().getStage().getSymbol("_tc_2x2crate").getVariable("Crate18_g rid"),10);
    var myGridCheck9 = parseInt(sym.getComposition().getStage().getSymbol("_tr_2x1crate_h_1").getVariable("Crate 19_grid"),10);
    var myGridCheck10 = parseInt(sym.getComposition().getStage().getSymbol("_tl_3x1crate_h").getVariable("Crate20 _grid"),10);
    var myGridCheck11 = parseInt(sym.getComposition().getStage().getSymbol("_tr_2x1crate_h_2").getVariable("Crate 21_grid"),10);
    // Create a variable called myGridCheckSum, make sure it's a number and sum the above
    var myGridCheckSum = 0;
    myGridCheckSum = myGridCheck1 + myGridCheck2 + myGridCheck3 + myGridCheck4 + myGridCheck5 + myGridCheck6 + myGridCheck7 + myGridCheck8 + myGridCheck9 + myGridCheck10 + myGridCheck11;
    //-- Logic & Conditional Statements
    // If this crate is in any position other than "Moved", and more than 1 box is already out of grid zone - prevent move and alert
    if ((mySelfCheck != "Moved") && (myGridCheckSum >1)){
    alert('Too many boxes outside of grid zone');
    sym.stop();
    // Or else, if this crate is in any position other than "Moved", but less than 2 boxes are out of grid zone - allow move
    else if ((mySelfCheck != "Moved") && (myGridCheckSum <2)){
    sym.play();
    // If this crate has moved but the other crate hasn't moved, play remainder of symbol timeline
    else if ((mySelfCheck == "Moved") && (myCrateCheck != "Moved")){
    sym.play(3001)
    // If this crate has moved and the other crate is also moved, alert and loop back on timeline
    else if (myCrateCheck == "Moved"){
    // Alert user to say crate cannot be moved
    alert('This box is being blocked by another!');
    sym.play(2999);

    Resolved. Silly little syntax error on a variable rewrite on another symbol!

  • Newbie-made animation in graphic symbol timeline by mistake! Can't get it out

    Tha't s only one problem...
    I am making a very simple stick figure animation which will be intended for tv, specifically HDTV 1080p
    I have no idea how i did it but I did the animation and before I knew it it was not on scene 1, but on the graphic symbol timeline. I think it is because I made my character a symbol, and i guess everything followed. But when I put them on the stage from the library, only part of the animation shows up, the part with the character i made into a symbol...not only that, but if I copy and paste all the frames from the symbol timeline onto the main timeline, it is HUGE! it doesn't match the size or placement it was on in the other timeline...
    Also, are there any specific requirements for editing with intent for hdtv? I read you can't use movie clips but as for size, etc? What do you have to set at the beginning and what will change when it is exported or converted for tv? I could use Final cut if it helps with the final stuff too.
    HELP!

    any advice at all? Its urgent

  • Playing a symbol timeline in Edge from Javascript function in an exteranl web page

    All-
    I have a javascript function in an external web page.  i want to use this function to call a symbol timeline inside an edge file.
    i've read about bootstrapping but i'm unsure how to use it in my project
    any ideas?
    Z

    Hi again Elaine,
    I actually had some success after many attempts with using your code. I can control the .stop() and .play() of the "NamePlate_sym" symbol. Yet, I am still having trouble doing anything else with it. I cannot .hide() it, nor use .html("Change text") on another element on the stage called"Rectangle". If I can accomplish that and all a global function on the stage, I'm in good shape.
    I placed the following script in the header of the .html file that gets loaded into the iFrame within the Edge composition:
      <script type="text/javascript">
       window.parent.AdobeEdge.bootstrapCallback(function(compId) {
       comp = window.parent.AdobeEdge.getComposition(compId).getStage();
       alert("CompID is "+compId);
       var symbol = document.createElement('div');
       symbol.innerHTML = 'Rotate';
       symbol.style.cssText = 'background-color:#fea; width: 50px; text-align: center;';
       symbol.style.cursor = 'pointer';
       symbol.onclick = function() {
        if (comp.getSymbol("NamePlate_sym").isPlaying()) {
         comp.getSymbol("NamePlate_sym").stop();
        else {
         comp.getSymbol("NamePlate_sym").play();
       window.parent.document.body.appendChild(symbol);
            </script>
    Once I put window.parent. in the first two lines of code and the last, my test worked. As I mentioned earlier though, I still can't get the syntax correct to .hide() an element (i.e. comp.getSymbol("NamePlate_sym").hide(); does not work), or more importantly, change the innerHTML value of an element on the stage. The code either does nothing or freezes.
    Thanks... Tommy

  • Access main stage from a symbol timeline?

    Can I access main stage  from a symbol timeline?
    Eg:
    I have a symbol called "ball" and its own time line. There is a close button at the end of ball's timeline,
    When close button pressed, I want to go back to main timeline.
    Thanks
    Phyle

    Thanks Hemanth.  I will try to explain.
    Open Edge animate. On the main stage I added a label called "home".
    I created circle, converted to symbol, renamed to "ball".
    Inside "ball" , I have a animation, at the end there is a button called "closeBt"
    When "closeBt" pressed, I want to go back to main stage "home"

  • Reset button for all symbol timelines on stage

    I have mulitple slide shows in my animate document, and I have three buttons at the top of the document that a user can click. Each button calls certain slideshows, (which are symbols) and causes them to animate using sym.getComposition().getStage().getSymbol("mySymbol").play. This works great, but once I click a different button, the symbols that the other button activated keep animating.
    I know I can reset the symbols timelines by referencing each slideshow by name individually, but is there an easier way? I have so many symbols!
    Thanks in advance!
    Erik

    So how many symbols and what code do you have on the buttons.
    I would use something like this:
    make an array of the symbol names.
    var mySymbols = ['mySymbol1','mySymbol2','mySymbol3','mySymbol4'];
    sym.$('btn1').click(function(){
         for(i=0;i<mySymbols.length; i++){
         // stop all the othersymbols and return their timeline to the beginning.
         sym.getComposition().getStage().getSymbol("mySymbols[i]").stop(0);
         // play only this symbol on the click event
          sym.getComposition().getStage().getSymbol("mySymbol1").play();
         or
         // sym.getComposition().getStage().getSymbol("mySymbol[0]").play();  // calls 1st array element
    Use same for other buttons.

  • Classic Tweening Issue in Symbol Timeline

    Hi,
    To help you understnad the question, I'll start by describing the simple animaiton I'm tryig to create. Basically it's just a conical shaped birdcage that will be swaying left to right slightly as if being blown by a breeze. The swaying will be accomplished by setting the transform pivot at the top of the symbol and animating the rotation left to right, and back to left (to complete a loop)
    Here's the process I'm using:
    Using cs5, I brought a .png onto the stage, and converted it into a symbol (movie clip). I then double-clicked the symbol to bring up it's timeline. I put 60 frames in the timeline (which matches the # of frames in the main timeline) with a keyframe at 1, 30, & 60. At frame 1 I use the free transform tool with the pivot set to the top and make a slight rotation to the left. I do the same at frame 30, but I rotate in the opposite direction. Lastly, I copy the keyframe from frame 1 and paste it at frame 60 to complete a looping animation. Finally I right-click the timeline and create a classic tween (on both sides of the middle keyframe).
    The problems is that when the animation plays, the rotation is not tweening. Yes, the rotation changes but only ON the keyframe. In-between keyframes the rotation turned into a slight position change instead.
    Now, when I follow the same process described above on the Main scene timeline, everything works. The tweening issue seems to only be happening while working on the symbol timeline.
    Thanks.

    When you doubleclick the symbol to edit it, you are inside the symbol, on its timeline, editing the content it contains, which is the image you placed there.
    What you should do/try is first convert the image to a graphic symbol, such that you see a graphic symbol in the library (you could use a movieclip or button as well, but a graphic will work).  Then do what you did for the image... place it on the stage, convert it to a movieclip, and then doubleclick the movieclip to edit what's inside it (which is now the graphic symbol instead of the raw image).

  • Get symbol timeline to play EVERY TIME the button is clicked?

    I have an animation with a button, when the button is clicked a symbol timeline is played from a label at the beginning of the timeline.
    After the button is clicked the first time it will not play the timeline again until the page is refreshed.
    How can I get the button to play the symbol's timeline any time it is clicked without having to refresh the page?

    Yes - you could put your buttons in a group and use $.each.  bellow is how to do it but I am sure there are other ways you could do it.
    Here is an example - you have a group div called buttons that contains all your different buttons. (they can have any name since it will look for the children of the buttons div in order from bottom to top of the stack in your buttons div. I add a mouseout or mouseleave on the buttons to send the timelines back to 0.
    The symbols are called symbol_1, symbol_2, etc in the example below but you could also make an array of the symbol names like var mySymbols = ['first','second','third','fourth','fifth']; and use sym.getSymbol(mySymbols[i]).play();
    var buttons = sym.$("buttons").children();
    $.each(buttons,function(i){
              $(this).on("click", function(){
                        sym.getSymbol('symbol_' + i).play();
    $(this).on("mouseout", function(){
      sym.getSymbol('symbol_' + i).stop(0);
    Below the group div is called btnSummer and had multiple buttons into it.

  • Control a symbols timeline from with in another symbol

    I just started using this product.
    I love it.
    I am currently building a project.
    I have a button inside of a symbol, and this symbol is on the stage.
    I am trying to use this button to start an animation from a label in a second symbol that is on the stage.
    I cant figure out how to amend sym.getSymbol("one").play("start");
    to say
    go outside of this symbol to the main stage and get the second symbol and then play it form the label.
    Or
    go outside of this symbol and get a symbol from with in the second symbol and then play it form the label.
    Can you help me with this.
    thanks again for the awesome product.

    I had on other question.
    I have a timeline full of symbols.
    Most of the symbols have nested buttons and symbols that responed to those buttons.
    I have the whole thing scrolling back and forth slowly.
    I want to be able to change the direction it scrolls relitive to the half of the project your mouse is hoverning over.
    I.E. hover over the right hand side and the timeline scrolls right and hover over the left hand side and it scrolls to the left.
    I can achieve this buy placing transperant symbols that cover each half of the stage and addind either play or play reverse respectively.
    But these transparent symbols block the symbolsand buttons and such that i have below them.
    So then i though i will put the transperant symbols towards the bottom of the heirocracy and as i suspected the symbols in front of the transperant buttons block them.
    is the some code i can add to the stage to achieve this?
    thanks a million

  • Control a symbol timeline from another symbol timeline on specific condition

    Hi! I have 8 animated symbol that plays on clicking over them on the main stage and i want, for example, that if symbol 1 animation is complete and i click on symbol 3, symbol 3 plays forward and symbol 1 plays on reverse and vice versa just like this: http://www.framefarm.net/eugenio/edge/example/example.html
    please help!

    I put together a Composition that I think does what you're asking. it's not elegant, but it works.
    in the timeline of Symbol_1
    place stop() triggers at the start and end
    in the same triggers, set a Symbol variable that states whether the animation has finished i.e. sym.setVariable("isDone", "false");
    place a trigger on the rectangle to play() or playReverse() depending on an if() statement about the variable
    in the timeline of Symbol_3
    place stop() triggers at the start and end
    in the same triggers, set a Symbol variable that states whether the animation has finished i.e. sym.setVariable("isDone2", "false");
    place a trigger on the rectangle to:
    declare 2 new variables, which use sym.getVariable() to get isDone and isDone2 as above,
    play() or playReverse() depending on an if() else if() else if() statement about both variables
    I used the relative string to get the local variable and absolute string to get the variable from the other Symbol, i.e.
    var myVariable = sym.getComposition().getStage().getSymbol("Symbol_1").getVariable("isDone");
    var myVariable2 = sym.getVariable("isDone2");
    I can send you the entire code if that helps.

  • Adobe Premiere Pro: place image sequence in reverse order on timeline

    Hi all,
    I have a jpg image sequence numbered from frame000 to frame100. It imports in numerical order...obviously. I am trying to find a way of dragging the files onto the timeline so they begin at frame and descend in order. Shift clicking in the direction you want doesn't work as it does in aftereffects.
    I know I can nest and reverse the speed but I would prefer to avoiding nesting at this stage. I also have no option to renumber the files as this is how they are generated and I have a tonne of them to import.
    Hope someone can help.

    Lowflyingweasel wrote:
    Trent
    I'm sorry. I know this is not the way it's done. Within an hour you replied to this customer? I've posted mine days ago and haven't received any replies??!! How is that possible? Sorry Gingergingers for highjacking your thread.
    Trent. Please. Either you and your adobe friends shove me properly or tell me where to find the answer if it has already been discussed somewhere else.
    https://forums.adobe.com/thread/1685295
    I must be doing something seriously wrong if even the tread is ignored! Never mind the App.
    I hope it's not presumptuous of me to speak for Trent, but I know him well and we're in the same situation. We are not official tech support representatives for Adobe. We do our forum (and other support) work largely on our own time as a way to assist our customers. We just do this as time allows, so there is no way of knowing who's been waiting for days or just an hour. It's usually just a matter of what we see on the main page (or in our inboxes) when we happen to log on. Also, some issues are a lot easier to address than others. For example, this one was just a basic workflow problem that just needed to be sorted out and had a correct answer. The thread that you posted above was a lot more specific, not easily repro-able by all of us, and doesn't seem to have any easy answers (at least not yet). It's a lot harder for people to address when it's like that, which is probably why you received very few comments at first. I see that both Trent and Kevin have commented to try to help you now, so the best thing is to just try to work with them and other users to see if you can alleviate your frustrations a bit. I can empathize with your situation, but you have to understand that most of us are really just fellow users on here. Thanks for your support.
    I've marked Trent's answer to this thread correct BTW... Nice one, Trent! I'm glad it worked for you, Ginger.

  • Load another Edge project with a symbol timeline trigger

    I'm working on an E-book like project that basically every page is an Edge composition.
    I make a symbol within a turn-page animation that will play on click.
    And I have a timeline trigger in the symbol and I'm hoping there is a way to load another Edge project with that trigger.
    Is there a way to do so?
    Thanks.

    I put together a Composition that I think does what you're asking. it's not elegant, but it works.
    in the timeline of Symbol_1
    place stop() triggers at the start and end
    in the same triggers, set a Symbol variable that states whether the animation has finished i.e. sym.setVariable("isDone", "false");
    place a trigger on the rectangle to play() or playReverse() depending on an if() statement about the variable
    in the timeline of Symbol_3
    place stop() triggers at the start and end
    in the same triggers, set a Symbol variable that states whether the animation has finished i.e. sym.setVariable("isDone2", "false");
    place a trigger on the rectangle to:
    declare 2 new variables, which use sym.getVariable() to get isDone and isDone2 as above,
    play() or playReverse() depending on an if() else if() else if() statement about both variables
    I used the relative string to get the local variable and absolute string to get the variable from the other Symbol, i.e.
    var myVariable = sym.getComposition().getStage().getSymbol("Symbol_1").getVariable("isDone");
    var myVariable2 = sym.getVariable("isDone2");
    I can send you the entire code if that helps.

Maybe you are looking for