Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-21-2002, 11:06 AM   #1
matt poole
yackity shmackity
matt poole's Avatar
Join Date: Jun 2001
Location: London, UK
Posts: 340
Default eval ()

Im using this code:

ActionScript Code:
dropTarget = this._droptarget;     getTarget = dropTarget.substr(1, 10);     doTargetAlpha = eval(getTarget);     _root.doTargetAlpha._alpha = 50;

The _droptarget property returns a string with a '/' on it so I've used the substr() method to select the bit of the string I need (this works fine). They Im trying to convert the stirng contained in the getTraget variable to an identifier using the eval() method and then intend to use it to affect the alpha of the _droptarget clip.

However the eval() is returning 'undefined' every time.

can anybody help?
matt poole is offline   Reply With Quote
Old 10-23-2002, 12:55 PM   #2
The Placid Casual
sfa's Avatar
Join Date: Oct 2001
Location: Malta
Posts: 1,024

Try this-
ActionScript Code:
dropTarget = this._droptarget; getTarget = dropTarget.substr(1, 10); _root[getTarget]._alpha = 50;
or this
ActionScript Code:
_root[this[this.dropTarget.substr(1,10)]]._alpha = 50;
sfa is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 11:48 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.