1080 posts
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 6-7 years
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Interviewed on the Envato Notes blog
  • Referred between 500 and 999 users
+4 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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
flashblue says

eval(“Regular.easeOut”)

1080 posts
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 6-7 years
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Interviewed on the Envato Notes blog
  • Referred between 500 and 999 users
+4 more
damojo says

gives me an undefined…

344 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
flashblue says

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

1080 posts
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 6-7 years
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Interviewed on the Envato Notes blog
  • Referred between 500 and 999 users
+4 more
damojo says

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

= undefined!

:(

344 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
flashblue says

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

344 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
flashblue says

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

1080 posts
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 6-7 years
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Interviewed on the Envato Notes blog
  • Referred between 500 and 999 users
+4 more
damojo says

Did exactly as you said… Still not working.

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

279 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Netherlands
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 10 000 and 50 000 dollars
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
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