-
1. Re: Dynamically change symbol position
dhosford Feb 5, 2013 7:40 PM (in response to Phrase9)Hi there,
I would suggest having the fade in / fade out animation inside of the symbol, with labels for both fade in and fade out. Then, you would reference those labels in the button's mouseover and mouseout actions in the Open Actions panel using code like this:
mouseover
sym.getSymbol("mySymbol").play("fadeIn");
mouseout
sym.getSymbol("mySymbol").playReverse("fadeOut");
Just make sure that you put the fadeOut label at the end of the fade in animation, that way you don't have to animate a fade out as well, you can just play fade in backwards to get the same effect! : )
I am attaching a sample file for your reference, just click the image below to download it. Let me know if you need additional help or clarification. I hope this helps!
-
2. Re: Dynamically change symbol position
Phrase9 Feb 7, 2013 12:10 PM (in response to dhosford)I have an animation for the fade in/out. That's not the problem. I have a series of hotspots that diplay a popup on the mouseover. The popup is the exact same for every hotspot. I just want to change where the popup "pops up" (X and Y position).
I don't want to have 10 popups on the stage when I could just use one. For now this is what I will do, but I shouldn't have to do this.
Thanks for the reply.
-
3. Re: Dynamically change symbol position
resdesign Feb 7, 2013 10:16 PM (in response to Phrase9)You can use css to place your popup.
Below is a sample file to place randomly, an element, a symbol already on the stage, and a symbol loaded on the stage.
-
4. Re: Dynamically change symbol position
ywx012 Sep 8, 2014 12:41 PM (in response to resdesign)I tried your link, but I get a message that the owner has removed the file. Do you have another link?
-
5. Re: Dynamically change symbol position
resdesign Sep 8, 2014 1:06 PM (in response to ywx012) -
6. Re: Dynamically change symbol position
ywx012 Sep 8, 2014 2:39 PM (in response to resdesign)Thank you very much. The css() did not work for me maybe because I had scaled the symbol?
I was able to dynamically change the text with text():
sym.getSymbol('fraction1').$('numerator').text('15'); //this works
yet this does not work
var n = "30";
sym.getSymbol('fraction1').$('numerator').css("left", n);
-
7. Re: Dynamically change symbol position
heathrowe Sep 8, 2014 4:43 PM (in response to ywx012)Some css properties require the its unit option px, pt, % and so on.
In your case add px after 30 like this
var n="30px";
Darrell
-
8. Re: Dynamically change symbol position
ywx012 Sep 9, 2014 6:05 AM (in response to heathrowe)Thank you, Darrell, I tried that "30px". I also tried 30 + "px". Neither worked
-
9. Re: Dynamically change symbol position
Aubrey Scarza Sep 9, 2014 7:34 AM (in response to ywx012)Have you tried just doing
var n = 30;
without any quotation marks?
-
10. Re: Dynamically change symbol position
heathrowe Sep 9, 2014 7:38 AM (in response to Phrase9)It should work.
You must be doing something different. If I put the above in a click event on a button it works fine!
How are you implementing it?
Darrell
-
11. Re: Dynamically change symbol position
heathrowe Sep 9, 2014 7:57 AM (in response to heathrowe)Sample Preview: http://www.heathrowe.com/edge/cssmove/
Click green button element numerator moves 30 pixels to the right, based on
var n = "30";
sym.getSymbol('fraction1').$('numerator').css("left", n);
-
12. Re: Dynamically change symbol position
ywx012 Sep 9, 2014 9:07 AM (in response to heathrowe)I have a symbol named "fraction1" that lives in another symbol I named "Topic1". It contains a text element named "numerator". I want "numerator" to move to the right 30 pixels on creationComplete of "Topic1".
From creationComplete of "Topic1" I added the lines :
var n = "30";
sym.getSymbol('fraction1').$('numerator').css("left", n);
-
13. Re: Dynamically change symbol position
ywx012 Sep 9, 2014 9:09 AM (in response to ywx012)I have a symbol named "fraction1" that lives in another symbol I named "Topic1". "fraction1" contains a text element named "numerator". I want "numerator" to move to the right 30 pixels on creationComplete of "Topic1".
From creationComplete of "Topic1" I added the lines :
var n = "30";
sym.getSymbol('fraction1').$('numerator').css("left", n);
-
14. Re: Dynamically change symbol position
ywx012 Sep 9, 2014 10:15 AM (in response to ywx012)Darrell,
It works on the click of a button, but not on creationComplete
-
15. Re: Dynamically change symbol position
ywx012 Sep 9, 2014 10:33 AM (in response to ywx012)On the creationComplete event of a symbol the css() function does not work. This might be a bug in Edge Animate
-
16. Re: Re: Dynamically change symbol position
joel_pau Sep 10, 2014 5:59 AM (in response to ywx012)"On the creationComplete event of a symbol the css() function does not work." No. It runs fine.
Your sentence means (i assume) you are using Chrome, isn't it?
-
17. Re: Dynamically change symbol position
ywx012 Sep 10, 2014 12:19 PM (in response to joel_pau)I'm using Safari
-
18. Re: Dynamically change symbol position
joel_pau Sep 11, 2014 2:56 AM (in response to ywx012)So i am testing with Safari too (v 7.0.6).
Proof that: CSS properties runs using the creationComplete panels: creationComplete css.zip - Box
Your problem comes from another css property: position, display, margin, float...
I don't see your file.
-
19. Re: Dynamically change symbol position
ywx012 Sep 11, 2014 2:47 PM (in response to joel_pau)Thank you, Joel,
You're right some css properties do work but for some reason moving the object with the "left" property does not work. I was talking about moving an element 30 pixels to the right. What doesn't work is
sym.getSymbol("fraction").$("den").css("left", 30);
or
sym.getSymbol("fraction").$("den").css("left", "30px");
This line does not work. Try it
-
20. Re: Dynamically change symbol position
ywx012 Sep 11, 2014 2:51 PM (in response to ywx012)Do you know of an alternative?





