-
1. Re: Triggers on timeline not firing
resdesign Oct 28, 2014 11:48 AM (in response to QuadrantProductions)Hi there,
Remind me what version of Animate you are using.
The code you are using usually works with stage/compositionReady.
I would use a flag on the timeline. For example on frame 1 put C= 0; and one frame 20 C=1
Then in stage/CompositionReady you can have a conditional
sym.getSymbol("themenu").$("mytrigger").click(function(){
if (c==1){
// do something
}else{
if (c==1){
// do something else
}
});
-
2. Re: Triggers on timeline not firing
resdesign Oct 28, 2014 11:49 AM (in response to resdesign)If you are using 2014.1 and do not have jquery loaded change the click event to:
sym.getSymbol("themenu").$("mytrigger").bind("click",function() {
// code here
});
-
3. Re: Triggers on timeline not firing
QuadrantProductions Oct 28, 2014 11:59 AM (in response to resdesign)Thanks for much for the options.
I tried the 2nd option (I'm using 2014.1) it didn't work. So I'm going to try the 1st option with the conditional. How do you add a flag? Do you mean a trigger?
-
4. Re: Triggers on timeline not firing
resdesign Oct 28, 2014 12:03 PM (in response to QuadrantProductions)Give me a few minutes to test it. I had an error in the code.
-
5. Re: Triggers on timeline not firing
QuadrantProductions Oct 28, 2014 12:27 PM (in response to resdesign)Thanks so much.
I tried this too….
Didn't work though.
var mysymbol = sym.getSymbol("themenu").$("mytrigger");
element = mysymbol; //note if you don't call a variable but direct symbol add quotes like this sym.$("symbolname");
element.bind({
mouseenter: function() { alert("you entered"); // Do something
},
mouseleave: function() { alert("you left"); // Do something
},
click: function() { alert("you clicked");// Do something
}
});
-
6. Re: Triggers on timeline not firing
QuadrantProductions Oct 28, 2014 12:31 PM (in response to QuadrantProductions)Works on a document ready though. Just checked.
-
7. Re: Triggers on timeline not firing
resdesign Oct 28, 2014 12:34 PM (in response to QuadrantProductions)Seems to be working thought there is another way to find where you are with getPosition();
In order to check the value you have inserted on the timeline you could use timeline/update (click the {} on the left of the timeline to get to 'update '
You can add C=0; at frame 1 and C=1 at frame 20 on your timeline.
You can check the values by adding the code in the timeline/update as my the sample here: Check Variable on the timeline 2014.0.1.zip - Box
The same code could be in a click event. (See commented out in compositionReady)
if (C==0){
// someting
}
if (C==1) {
//something else
}
-
8. Re: Triggers on timeline not firing
QuadrantProductions Oct 29, 2014 8:18 AM (in response to QuadrantProductions)Thanks so much redesign I think I'm overcomplicating it though.
I'm trying to create a symbol that can be recycled throughout a site. The idea is it's a glorified mega manu object. once clicked, it slides open and shows options for any given section. I'm trying to reuse a symbol button inside the symbol though without having to create a keyframe.
Here's a brief image overview of what I mean. The whole idea is to dynamically change the instruction that is passed by clicking the button inside that symbol without having to create a new keyframe. Ideally everything would be done by code on a single frame but I'm not there yet.
-
9. Re: Triggers on timeline not firing
QuadrantProductions Oct 29, 2014 8:22 AM (in response to resdesign)Here are the files Dropbox - an-sidenav as per the note below. It might better show what I'm trying to do.
-
10. Re: Triggers on timeline not firing
resdesign Oct 29, 2014 8:36 AM (in response to QuadrantProductions)I commented out all your code and wrote this in compositionReady:
var C=1;
sym.getSymbol("themenu").$("menuBTTN").click(function(){
if(C==0){
sym.getSymbol("themenu").stop('openit');
C=1;
}else{
sym.getSymbol("themenu").stop('closeit');
C=0;
}
});
-
11. Re: Triggers on timeline not firing
resdesign Oct 29, 2014 8:38 AM (in response to QuadrantProductions)Here is the changed file:
-
12. Re: Triggers on timeline not firing
QuadrantProductions Oct 29, 2014 8:41 AM (in response to resdesign)Brilliant! This would then also allow me to individuate the actions respective of C=0 or C=1 (placing those on the timeline of the symbol right)…. I'll check the file.
While you were working this, could this be done on the update timeline option as well? I was just finagling that….
-
13. Re: Triggers on timeline not firing
QuadrantProductions Oct 29, 2014 8:46 AM (in response to resdesign)This works. But I don't understand. Where are you telling it where the c=0 and c=1 occur? I opened the file thinking I'd find it on the timeline triggers of the symbol the Menu but didn't see it.
-
14. Re: Triggers on timeline not firing
resdesign Oct 29, 2014 8:48 AM (in response to QuadrantProductions)it is in composition ready on the click event. Once you click your set the variable to 1 and when you click again you set it to 0 and so on.
-
15. Re: Triggers on timeline not firing
resdesign Oct 29, 2014 8:50 AM (in response to resdesign)var C=1;
sym.getSymbol("themenu").$("menuBTTN").click(function(){
if(C==0){
sym.getSymbol("themenu").stop('openit');
C=1;
}else{
sym.getSymbol("themenu").stop('closeit');
C=0;
}
});
-
16. Re: Triggers on timeline not firing
QuadrantProductions Oct 29, 2014 8:52 AM (in response to QuadrantProductions)I see it. In the document ready. I'm trying to decipher the code in english. Is this about right?
var C=1; // just set the variable C to = 1.
sym.getSymbol("themenu").$("menuBTTN").click(function(){ // if this button is clicked do this
if(C==0){ // if the variable C is equal to 0
sym.getSymbol("themenu").stop('openit'); // then tell the symbol to stop at the frame 'open it'
C=1; // I don't get this line.
}else{ // otherwise
sym.getSymbol("themenu").stop('closeit'); // tell it to go and stop at "close it"
C=0; // and set the value of C to 0 ????
}
});
What I'm trying to understand is how this code block tells C to be either 1 or 0 and when / how. Sorry if I'm complicating things… just trying to decipher / learn.
-
17. Re: Triggers on timeline not firing
resdesign Oct 29, 2014 8:58 AM (in response to QuadrantProductions)C=1; // I don't get this line.
This is resetting the variable on your first click. Then when you click again (else) it resets the variable to 0 and execute the if (C==0) when you click again.;
basically it toggles the variable between 0 and 1 at each click. The value is arbitrary. It could have been any 2 different values.
-
18. Re: Triggers on timeline not firing
QuadrantProductions Oct 29, 2014 8:57 AM (in response to resdesign)I get it. I need to write this from scratch to remember.
Thank so much!
-
19. Re: Triggers on timeline not firing
resdesign Oct 29, 2014 9:00 AM (in response to QuadrantProductions)My pleasure! Good luck on your project.




