1082 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Has been part of the Envato Community for over 6 years
+9 more
damojo says

Hi,

I want users to be able to select the easing type of a tween via xml. For example “Regular.easeOut”. How can I parse the string to a regular expression so it can be recognised by flash?

Thanks :)

344 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
flashblue says

eval(“Regular.easeOut”)

1082 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Has been part of the Envato Community for over 6 years
+9 more
damojo says

gives me an undefined…

344 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
flashblue says

I tried it. It works. Use eval(“text” )

1082 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Has been part of the Envato Community for over 6 years
+9 more
damojo says

var easing = eval(XMLdaten_easing[p]);
trace(easing);

= undefined!

:(

344 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
flashblue says

var easing = XMLdaten_easing[p]; easing = eval(easing );

344 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
flashblue says

Use the code above. You wrote it before giving text value.

1082 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Has been part of the Envato Community for over 6 years
+9 more
damojo says

Did exactly as you said… Still not working.

var easing = XMLdaten_easing[p];
easing = eval(easing);
trace(easing);

279 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+4 more
FonZ says

Have you tried making it a var first and then eval?

var easing = XMLdaten_easing[p];

myEase = eval(easing);

????

You could write an else if statement to construct what you need.

var easing = XMLdaten_easing[p];

Split it at the dot

mySplit = easing.split(”.”);

then check the first part of the mySplit

if(mySplit0==”Regular”){

construct what you need

} else etc

Then check the second. Bit more work involved and my coding could be off, but it’s an option.

Regards, FonZ

344 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
flashblue says

Trace parameter can’t be not understand it. Because, your text changes to Easing object. Try it on the tween method. It works so.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by