Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing JavaScript arrays from Flash 2

Status
Not open for further replies.
Dec 8, 2003
17,047
GB
Hi...

I'm looking for a way to read data from a JavaScript array based upon the same page as my movie. I'm using ActionScript 2.0 (and exporting the movie as Flash 6, from Flash 8).

The array contains fairly simple data:

Code:
var count_data = [];
count_data[count_data.length] = { date:'20060301', amount:234 };
count_data[count_data.length] = { date:'20060302', amount:444 };
count_data[count_data.length] = { date:'20060303', amount:2335 };
count_data[count_data.length] = { date:'20060304', amount:446 };
count_data[count_data.length] = { date:'20060305', amount:465 };

If it helps, I have Macromedia's Flash / JavaScript Integration Kit (JavaScriptFlashGateway.js) included on the page.

I know I could use an XML file, but for technical reasons, this is not feasible.

The only reason I'm looking to read directly from the array is that there could be a fair amount of data (365 strings and 365 integers), and don't know if there is a limit on the amount of data you can pass in the URL:

Code:
myFlashMovie.swf?data1=abc&value1=1&data2=def&value2=7 ... data365=xyz&value365=42

Thanks!

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Around 40Kb, eh?... well, I think that's more than enough for my needs, so I'll do it that way.

I was thinking the limit would be about 2.5Kb or something small.

Thanks for the info.

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
You may be able to pass 40KB data, but not by using the URI query string like you're doing. It is limited to 255 bytes, and browsers do not like more than c. 2000 characters URI.

For that and other reasons you may want to use FlashVars instead.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top