Edge Animate CC :: Play Random Symbols When Button Is Clicked
Oct 7, 2013I have a dozen or so animated symbols on the stage and I'd like a randomly called one to play each time users click a button.
View 6 RepliesI have a dozen or so animated symbols on the stage and I'd like a randomly called one to play each time users click a button.
View 6 RepliesSo my animation is a song and I'm doing like a video clip with interactivity (the interactivity is not inside at the moment).I need to have a play button so we can see (heard) on iPhone, iPad...
My problem is that the animation begin immediately behind the play button and before I press it.So the song and the animation are not synchronize.I try many things to stop the animation but nothing is working.
I have made a pause and a play button to my slideshow.The pause button is just a boks with the click-action code:
sym.$('btn').click(function(){
sym.stop();
});
The pause button is a boks with the click-action code:
sym.$('btnPlay').click(function(){
var timelinePos = sym.getPosition();
sym.play(timelinePos);
});
It works but in the beginning, I have to click twice before the function works. It is only the first time. After that everything works fine.
I have an animation with 5 different parts. I would like to trigger a random part when clicking on a button.
In order to do that I put labels on all parts (play1,...,play5). Then I put a code on the button on the click event :
var RandomNb=Math.floor(Math.random()*5)
if(RandomNb=1){sym.play("play1");}
It is just a simple test but it does not work : the animation play1 is always played no matter the value of RandomNb. I obviously make something wrong but I don't know what...
how can I get a Random Number in a Text by clicking a button?
For example: I have an already animated object [a dice] as button and I have a Text object located on other part of the stage and where should appear the random number from 1 to 6.
I have tried in CreationComplete and compositionReady, and in the Click option in the button, one of these two options:
Math.floor((Math.random()*6)+1);
var ran_number=Math.floor(Math.random()*5;
I have also tried in the dice image [button] within the symbol this [with one of the two previous codes]:
sym.getComposition().getStage().$("text").html(ran_number);
And it doesn't work anyway. Right now I'm basically lost. That would be like:
1.- start your computer.
2.- open Edge.
I have an animation that runs for around 2 minutes. I want to add a button that the user can click to pause/play this animation if they want extra time to read the content on screen. I'm not sure how to tell a button to pause at the current frame and resume when clicked by the user. The button will also need to change states from a pause image to a play image when clicked and vice-versa.
View 8 Replies View RelatedI have an animation in Edge, and I'm trying to make a button that can play the timeline for a specified amount of time and then stop, without the aid of labels. So, I figured if i set the button to sym.getSymbol("mysymbol").play(500); it would make the timeline of that symbol play for 500 milliseconds each time the button is clicked, but it is not working, as this makes the whole thing simply start playing at 500ms. So I then tried adding a stop action after this:
sym.getSymbol("mysymbol").play();
sym.getSymbol("mysymbol").stop(500);
But this didn't work, because I guess since these events are one after the other, it doesn't wait 500 seconds to stop, and it reads stop(500) immediately after the play instruction, so that didn't work either. I'm pretty new to javascript, but I've been really trying to learn it along with the Edge API for a couple weeks now and still can't seem to solve this problem.
...like a menu popping out and going back again.
View 7 Replies View RelatedI have created a symbol that is a horizontal banner consisting of six paragraphs of text P1 thru P6. Each paragraph is no more than 300 px wide.
I then created six trigger symbols and placed them beneath a 300 x 300 vieweing window on the stage.
When the stage opens, paragraph 1 (P1) is viewable in the window. If the user clicks a trigger, I want the banner to scroll left or right, from its current position, to display the corresponding paragraph.
Example : P1 is showing in the viewing window. The user clicks trigger #4. The banner scrolls right and eases P4 into view in the window. The user then clicks trigger #2. The banner then scrolls left and eases P2 into viewing position in the window.
My old (very old) Flash training tells me I need to set a numeric value into a variable when each trigger is clicked and then use that value and concatenate it with label text to tell the play head to play from the proper postion (play ("Para1")), (play ("Para2")), etc. where Para# is the label on the timeline.
I feel like I'm close to getting this to work, but after a number of hours of trying I've concluded that over time I've either forgotten a key step or there's some easier way to do this in Edge Animate. (I'm very new to CC and EA).
I am working on a project with several nested DIVs, and I would like to be able to get the top and left coordinates of a DIV when I click on it, relative to the Stage.
I used this code in the On Click action for the DIV:
var objTop = sym.$(e.currentTarget).css("top");
var objLeft = sym.$(e.currentTarget).css("left");
But, since this is a nested DIV, it seems to be giving me the coordinates relative to the parent, not the Stage.
When the user clicks on two button on the stage I need an eleiment to disapear.
for example:-
If one of the buttons is pressed... nothing should happen.
Then when the other button is pressed then an element disapears.
(The user needs to be able to press the buttons in any order)
I have been usine verables to try and work this out. How I understand it is that I sould be able to store the verable on the stage and recall it.
This is where I have the problem. I have not pasted the stage code because it just does not work. But below is the code for one of the Symbol Button.I had set all the "Var" to "0" at the stage but can not change all recall them.
sym.getSymbol("button1").play();
var but1 = 1
};
if (but1 = 1 && but2 = 1){
sym.$("element1").hide();
};
I have come across about a dozen similar discussions, but most have presented solutions that worked in earlier versions of Edge and no longer work.
I am trying to use Edge to build animations that can then be integrated into larger non-Edge projects. I would like to then be able to control the Edge timeline or Edge symbols from elements OUTSIDE of Edge, such as another link or button in the page.
I cannot seem to figure out how to properly reference the Edge stage or symbols.
I have come across several proposed solutions for referencing Edge stage, such as:
var comp = AdobeEdge.getComposition("EDGE-966604542");
var stage = comp.getStage();
var comp = $.Edge.getComposition("EDGE-966604542");
var stage = comp.getStage();
var comp = Edge.getComposition("EDGE-966604542");
var stage = comp.getStage();
and these either DO NOTHING or throw errors about either AdobeEdge or Edge or comp being undefined.
In my Composition there some cases I have to play one symbol. In a few cases it is necessary two play sequential e.g. symbol A an then symbol B. It have to look like one animation. Is there an easy way of calling?
View 19 Replies View RelatedI have a keyframe where I must to upload a random series of symbols, and I do it with the script:
var myVar = Math.floor((Math.random()*6)+1);
var stage = sym.$("Stage");
var myAni = sym.createChildSymbol("Symbol_" + myVar, "stage");
myAni.appendTo(stage);
The script works fine, but, at NEXT keyframe I must load another series. The problem is that the symbol loaded in the previous keyframe is still present and the new symbol overlaps it.How can I unload or discard the previous symbol?
I have a banner I have been working on with three spinners like a slot machine. Currently I have everything hand animated to rotate the spinners to spin to one of 4 options each. What I would like is to have a button that triggers the spinners to rotate to a random ( 1 of 4 ) points over the course of 1/2 second 500ns.
Is there a code snippit that will make an object rotate to one of 4 chosen variables?
I have several animations converted to symbols and I want the composition to call one at random on load. These will be page header animations and my intension is use the same composition on each page that pulls an animated header at random when the page loads. I've done this with Flash using Actionscript but not sure how to code it out in Edge.
View 14 Replies View RelatedI've created an Edge animation (marquee) banner for a site I'm working on, but when I check it on older computers (for example XP running IE7), all I see is a large white rectangle where the marquee is supposed to be. A
View 5 Replies View RelatedI'm building an animated menu in the latest version of Adobe Animate. There are 5 different animations that happen within the same box on the main stage. I have made each animation it's own symbol. I want to trigger the animations from text boxes to the left of the box where the main animation takes place. The text boxes are not apart of any of the symbols, but are just on the main stage.
When someone scrolls over any of the individual text boxes i need to play one symbol's timeline AND hide all of the other symbols from the stage.
I have a symbol,some timaline and labels in it.so now I want to play reverse between the Label A and Lable B but the action syntax is like
test1_play.playReverse();
so how can I play reverse rom LableB to LableA?
sym.playReverse ( position, executeTriggers )
position defaults to the current playhead position (which defaults to 0); If play is issued and the playhead is at the end of the timeline, play from the end.executeTriggers can be true, false, or null and indicates whether triggers at the starting position are fired:true - all triggers at the starting position are fired.false - no triggers are fired at the start point.null, undefined or omitted - triggers are fired at the starting position only if the timeline is being played for the first time, or if the starting position is different than the current playhead position as returned by getPosition().Description: Play the default timeline in reverse from the given position given in milliseconds (if position is a number) or as a label (if position is a string).
Is there way to revert or un group assigned symbols?
View 2 Replies View RelatedI have created an animation and I would like clicking on a button (javascript) that is within the outer body, start the animation.
View 1 Replies View RelatedI have and element and what I'm trying to do when I click on this element, it starts to play reverse the timeline for 1 sec and after that it continues to playing the timeline from an other point.
View 3 Replies View RelatedI am creating a slide show and I added a stop and click to play action so it is interactive so the user must click to go to the next slide. The stop is working but the click an day is not when I preview in the browser?
View 4 Replies View RelatedI created an Edge Animate document and it has text animations where the text fades in and out. Now it works fine in IE and Chrome but not FireFox. All the text displays all at once in a jumbled mess.
View 2 Replies View RelatedI saw a post on this issue but was not sure where to put the code I read there. how exactly to edit this code line to work
I am inside a symbol "oneAnimation". At the end of the animation "backBtn1" appears. Inside this button, I have added an event on click. I want the stage timeline to play from the label "startNumber" when this button inside the symbol is clicked.
So far it's not jumping back to the main time line.
sym.getComposition().getStage().play("startNumber");
All- I have a symbol on the main stage called "Con-main" that has a symbol inside of it called "VID-PLAY". I have a symbol inside of "VID-PLAY" called "RC-VID"
I'm trying to hide this symbol on creationComplete within VID-Play
sym.getComposition().getSymbol("CON-MAIN").getSymbol("VID-PLAY").$("RC -VID").hide(); //DOESN'T WORK
sym.getComposition().getStage().getSymbol("CON-MAIN").getSymbol("VID-P LAY").$("RC-VID").hide(); //DOES NOT WORK
what am i missing?
I am trying to make a fairly simple user interface. I have 3 buttons on stage and each button will pull out a correspoinding symbol from the library and display it on the stage.
Eg. Click btn1 and it will show content1 from the library.
So far it is working in that it shows the corresponding content but it appends subsequent content to the bottom of it. I need the content to be replaced instead.
I would prefer if I could dynamically get content from the library instead of having items on stage that are set to 'hide' and 'show'.
Note: I noticed that when you create a child symbol on stage that Edge gives it a randomly generated ID. There is some code towards the bottom that tries to rename its ID attribute. I am not 100% sure if it is even doing what I expect it to do.
var btnArray = ['btn1','btn2','btn3']
function init(){
for (var i = 0; i < btnArray.length; ++i) {
[Code]....
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.
I want a command that sets a symbol's timeline position based on another symbol's timeline position.
My case: Im making a intercative animation of a room, where i have a black screen symbol ("filmepreto") with a opacity animation over my room image. That symbols adjusts de room ilumination.
I have a symbol with an animation of a curtain closing (cortina) and another one with a roof lamp that gets on or off controlled by a button. When the button that turns the roof lamp the position of the "filmepreto" must be the same of the curtain. Both the curtain animation and the "filmepreto" animation have the same lenght.
I have more things that interefere on the ilumation of the room but, if I have the code to sync the off state of them with the position of the curtain animation i think I can set everything.
I created 5 buttons in Edge CC that appear one after the other. After converting them to symbols, they still appear one after the other in the timeline, but in a browser preview they all appear at the same time.
View 2 Replies View RelatedI'd like to target all child symbol instances of my mT symbol and hide them.
Something like this (except this doesn't work):
childsymbols_d1 = sym.getSymbol("holder").getSymbol("d1").getSymbol("mT").getChildSymbols();
for(var i=0; i<childsymbols_d1.length; i++){
childsymbols_d1[i].hide();
};
I don't want to use the timeline because I have a lot of child symbols, and would like to do this operation on several other symbols.