Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > Server-Side Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-08-2002, 10:41 AM   #1
lamiaborn
Registered User
 
Join Date: Nov 2002
Location: London
Posts: 10
Default Sending variables to Flash via the URL

Hi Folks,

I am trying to figure out how to load variables into flash via the URL. For example in ASP you can add text to the URL and display it in a specified location... I would like to send text to flash player by entering something like www.lamiaborn.co.uk/flash.swf?text=lamia+born+is+here.. Any ideas?
lamiaborn is offline   Reply With Quote
Old 11-08-2002, 01:28 PM   #2
tost
my pleasure
 
tost's Avatar
 
Join Date: Apr 2002
Location: gent.be
Posts: 792
Default

can be done.
you can get the url as a property, then strip the url until the "?" appears using indexOf, and split the remaining substring into vars. i'm home right now, but i'll post you the code in an hour or so..
tost is offline   Reply With Quote
Old 11-08-2002, 02:09 PM   #3
lamiaborn
Registered User
 
Join Date: Nov 2002
Location: London
Posts: 10
Default

Thanks a lot, it would be great if you could post some code
lamiaborn is offline   Reply With Quote
Old 11-08-2002, 04:07 PM   #4
tost
my pleasure
 
tost's Avatar
 
Join Date: Apr 2002
Location: gent.be
Posts: 792
Default errre ya go

put this in frame 1 of your movie

myURL = this._url;
myPos = myURL.lastIndexOf("?");
vars = myURL.substring(myPos+1, myURL.length);
// this returns the querystring elements - you can now split these using split


cheerz
tost
tost is offline   Reply With Quote
Old 11-08-2002, 04:12 PM   #5
tost
my pleasure
 
tost's Avatar
 
Join Date: Apr 2002
Location: gent.be
Posts: 792
Exclamation beware

this is not the most reliable method, and i wouldn't recommend using it for more than passing an id or something else very short. Complete texts might give problems in some cases.
So, rather then passing the complete texts, pass a code to your swf so it knows which text to load, and then load it from inside your movie with a loadVars
succes
tost
tost is offline   Reply With Quote
Old 11-11-2002, 07:12 AM   #6
lamiaborn
Registered User
 
Join Date: Nov 2002
Location: London
Posts: 10
Default

I will give that a try - cheers heaps!!!
lamiaborn 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 09:24 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.