Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Passing variables from HTML to Flash CS3

This is a discussion on Passing variables from HTML to Flash CS3 within the Tutorials forums, part of the English Forums category; Originally Posted by cooljackD hi flep how would you retrieve the flashvars if you intend to use in an external ...


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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 01-02-08, 08:24
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,446
Rep Power: 6
Flep is on a distinguished road
Re: Passing variables from HTML to Flash CS3

Quote:
Originally Posted by cooljackD View Post
hi flep
how would you retrieve the flashvars if you intend to use in an external swf

since with flash cs3 you need a preloader and the your app how to you get the flash vars in the app after it is loaded by the preloader ???
Hi cooljack,
sorry I don't get you...
this tutorial shows how to pass a variable from HTML to Actionscript.
If you load an SWF...you can't load its html code too
__________________

 


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

  #12 (permalink)  
Old 01-02-08, 08:25
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,446
Rep Power: 6
Flep is on a distinguished road
Re: Passing variables from HTML to Flash CS3

Quote:
Originally Posted by rexus View Post
try_txt1.text = my_array[0];
try_txt2.text = my_array[1];
Does it not work ?
__________________

 


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

  #13 (permalink)  
Old 01-02-08, 14:02
Junior Member
 
Join Date: Dec 2007
Posts: 12
Rep Power: 0
cooljackD is on a distinguished road
Re: Passing variables from HTML to Flash CS3

thks for the quick answer flep anyway i found a workaround using flash.external.ExternalInterface to pass the flashvars from the main to the externalmovie

anyway that did the trick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #14 (permalink)  
Old 01-02-08, 14:03
Junior Member
 
Join Date: Dec 2007
Posts: 12
Rep Power: 0
cooljackD is on a distinguished road
Re: Passing variables from HTML to Flash CS3

i have a new question, how do you retrieve both values and keys from the flashvars inorder to push them in an array ????
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #15 (permalink)  
Old 01-02-08, 14:10
Junior Member
 
Join Date: Dec 2007
Posts: 12
Rep Power: 0
cooljackD is on a distinguished road
Re: Passing variables from HTML to Flash CS3

Code:
for (var Key:string in obj)
{
     var o:Object = {Key:obj[Key]}
     myArray.push(o);
}

Last edited by cooljackD; 01-02-08 at 14:11.. Reason: code not appearing !!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Flash Multi Gallery
  #16 (permalink)  
Old 18-07-08, 12:56
Junior Member
 
Join Date: Jul 2008
Posts: 1
Rep Power: 0
siva1117 is on a distinguished road
Re: Passing variables from HTML to Flash CS3

Hi can u provide the source file of your above example? I tried but not working for me...:-(
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #17 (permalink)  
Old 24-08-08, 02:47
Junior Member
 
Join Date: Aug 2008
Location: Jakarta, Indonesia
Posts: 4
Rep Power: 0
drudy is on a distinguished road
Re: Passing variables from HTML to Flash CS3

You may try this one (just a simple short-code):

var obj:Object=LoaderInfo(root.loaderInfo).parameters;
try_txt1.text = String(obj['id']); // get value from variable named as 'id'
try_txt2.text = String(obj['ir']); // get value from variable named as 'ir'

Thank's.

Last edited by drudy; 24-08-08 at 02:51..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #18 (permalink)  
Old 27-08-08, 16:17
Junior Member
 
Join Date: Aug 2008
Posts: 2
Rep Power: 0
b007 is on a distinguished road
Re: Passing variables from HTML to Flash CS3

Hi, can u help me from de beggining what I should do and define in *.fla file to make it work,
Which object I value I have to set to each object I got and how.
next this How I should define in in the HTML file,
like this...
variable1=value1&variable2=value2&variable3=value3...]>

Thanks, Gil.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #19 (permalink)  
Old 29-08-08, 00:13
Junior Member
 
Join Date: Aug 2008
Location: Jakarta, Indonesia
Posts: 4
Rep Power: 0
drudy is on a distinguished road
Re: Passing variables from HTML to Flash CS3

Just simple like this ...

var obj:Object=LoaderInfo(root.loaderInfo).parameters;
text_object1.text = String(obj['variable1']); // get value from variable named as 'variable1'
text_object2.text = String(obj['variable2']); // get value from variable named as 'variable2'
text_object3.text = String(obj['variable3']); // get value from variable named as 'variable3'

Thank's.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #20 (permalink)  
Old 29-08-08, 02:54
Junior Member
 
Join Date: Aug 2008
Posts: 2
Rep Power: 0
b007 is on a distinguished road
Re: Passing variables from HTML to Flash CS3

Didnt got you,
it mybe simple to u, but to me it's not.
What should I do in the Flash before?
How to define those parameters in the flash?

after that,
What should be (the whole code, not just a part of it) in the HTML file.
Thanks, Gil.
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

Similar Threads

Thread Thread Starter Forum Replies Last Post
Actionscript 3 passing array button to animate gwulfwud advanced Actionscript 3.0 1 02-09-08 12:33
Displaying PHP Variables in Flash chosendesigns PHP | mySQL | Flash CS3 1 14-05-08 13:49
passing DisplayObject references trough XML dedavai advanced Actionscript 3.0 1 21-01-08 10:11
passing DisplayObject references trough XML dedavai advanced Actionscript 3.0 0 21-01-08 09:43
Tutorial 1 the variables Flep Actionscript for beginners - tutorials 0 01-11-07 06:47


All times are GMT. The time now is 00:55.


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