1081 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has referred 500+ members
+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”)

1081 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has referred 500+ members
+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” )

1081 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has referred 500+ members
+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.

1081 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has referred 500+ members
+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.

by
by
by
by
by
by