Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > Just for Kicks Challenges

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-30-2009, 12:16 PM   #1
orange gold
got as?
 
Join Date: May 2007
Posts: 507
Default variables containing code

well... lets say i have a variable called rop5 (rotation positive 5)
rop5 = _rotation += +5
then i want to say object1.rop5
well obviously this will never work... my just for kicks challenge is to find a similar way to make the following code work!

ActionScript Code:
vas1 = "_" //vas = variable action script... but thats not important :) vas2 = "r" vas3 = "o" vas4 = "t" vas5 = "a" vas6 = "i" vas7 = "n" vas8 = vas1 + vas2 + vas3 + vas4 + vas5 + vas4 + vas6 + vas3 + vas7 vas9 = "object1." + vas8 + " += +5" trace(vas9) _root.onEnterFrame = function() {     vas9 }


HAVE FUN!
__________________
Feel free to PM me if you have a question

Last edited by orange gold; 06-30-2009 at 12:19 PM..
orange gold is offline   Reply With Quote
Old 07-01-2009, 01:29 AM   #2
dialectric
Senior Member
 
dialectric's Avatar
 
Join Date: May 2006
Location: USA
Posts: 181
Default

From another thread, http://www.actionscript.org/forums/s....php3?t=180017 , it looks like you could do this with an external interface call.

-dialectric
dialectric is offline   Reply With Quote
Old 07-05-2009, 10:11 AM   #3
bowljoman
Senior Member
 
Join Date: Jan 2008
Posts: 302
Default

ActionScript Code:
package {     import flash.display.Bitmap;     import flash.display.Sprite;     import flash.events.Event;     public class tests extends Sprite     {         [Embed(source='fence.png')]         public  var image:Class;         public  var obj:Bitmap=new image();                 public  var rot:String='rotation';         public  var someVar:String='obj';                        public function tests()         {             addChild(obj);                  this.addEventListener(Event.ENTER_FRAME,frame);           }                 public function frame(e:Event):void         {             this[someVar][rot]+=1;         }     } }
__________________
What does 'int main(int argc, char** argv )' mean?
bowljoman is offline   Reply With Quote
Reply


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 06:59 PM.


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