Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

eval or something like it

This is a discussion on eval or something like it within the Flash CS3 eng forums, part of the English Forums category; Hi there, I have an XML menu and I would like to be able to execute a function on a ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 28-10-07, 08:17
hard_overclocker's Avatar
Moderator
 
Join Date: Jul 2007
Posts: 51
Rep Power: 2
hard_overclocker is on a distinguished road
eval or something like it

Hi there,
I have an XML menu and I would like to be able to execute a function on a particular button click. (the function name will come from xml). I belive this could be achived with eval in AS2.
Any ideea how to do this ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 28-10-07, 08:25
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: eval or something like it

Hi,
you can push functions into an Array:
Code:
var functions:Array=new Array();

function go():void
{
	trace('go');
}

functions.push(go);
functions[0]();
If your XML value=='go' then functions[0]();
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 28-10-07, 08:52
hard_overclocker's Avatar
Moderator
 
Join Date: Jul 2007
Posts: 51
Rep Power: 2
hard_overclocker is on a distinguished road
Re: eval or something like it

Thanx a lot I'll give it a try

Have a nice day
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 14-11-07, 20:59
Member
 
Join Date: Nov 2007
Posts: 59
Rep Power: 2
gwulfwud is on a distinguished road
Re: eval or something like it

hey guys,
i don't mean to hijack this thread...but i can't find what's the main purpose of the ".push"...
can you please enlighten me...

thanks!
g
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5 (permalink)  
Old 14-11-07, 21:06
hard_overclocker's Avatar
Moderator
 
Join Date: Jul 2007
Posts: 51
Rep Power: 2
hard_overclocker is on a distinguished road
Re: eval or something like it

Hey gwulfwud,
.push is pretty strightforward, all it does is to add the item (object, function, whatever) to an array (on the last position).

Code:
the_array.push(item)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Flash Multi Gallery
  #6 (permalink)  
Old 15-11-07, 15:02
Member
 
Join Date: Nov 2007
Posts: 59
Rep Power: 2
gwulfwud is on a distinguished road
Re: eval or something like it

so let's say i have an xml based mp3 player..
my current song is on [1]...if i want the next song [2] to play by clicking a button then i need that push where? after the MOUSE_UP event ? or during the event where the music's url are being generated? a bit confused with this xml thing..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 16:16.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406