Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-26-2007, 02:05 PM   #1
Registered User
Join Date: Sep 2007
Posts: 1
Default Accessing flashvars

Just starting to learn flash and actionscript, so please forgive my ignorance. I've also tried searching etc. but I couldn't find any subject that adressed my specific question

I'm trying to pass some variables to an actionscript using flashvars. I've written a php script that will generate the HTML needed:
<PARAM NAME=FLASHVARS VALUE="year=' . $year . '&month=' . $month . '&day=' . $day;
and also this:
FLASHVARS="year=' . $year . '&month=' . $month . '&day=' . $day;
inside the embed HTML tag as I understand that you need both for cross browser compability.

Now what I want to do next is to get this info and store it in some variables in actionscript, and I've read various tutorials on how to do it, but I just can't seem to get it to work. This is the actionscript i'm using, which obviously doesn't work?
var targetYear = trace(year);
var targetMonth = trace(month);
var targetDay = trace(day);
BTW, i'm using Adobe Flash CS3 set to actionscript 1.0 & 2.0. I think I read somewhere that flashvars only work with Flash MX, but I don't know if that's true, or, indeed, what Flash MX is...

Could anyone explain what I need to do, and help a poor newb out here?
Thanks in advance
trident is offline   Reply With Quote
Old 10-02-2007, 11:40 AM   #2
Registered User
Join Date: Sep 2007
Posts: 18

Hi there

You just need to remove the word trace from your code. It should read like this...

var targetYear = year
var targetMonth = month
var targetDay = day

Also, flashVars will only send through strings, so make sure if your using the values as numbers, to specify it as a Number(month).

Only use the trace method to write the values to the output window in Flash.


mikenaman is offline   Reply With Quote

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
FlashVars + Text + Help + Easy Question! WallySomebody ActionScript 2.0 0 01-15-2007 06:30 PM
Help with FlashVars Navigation Leifish ActionScript 2.0 1 05-28-2005 03:03 AM
flashvars and external text files BeoWolfe ActionScript 2.0 1 04-15-2005 09:05 PM
FlashVars and Valid Cazz HTML and JavaScript 4 03-29-2005 02:40 PM
escaping ASCII characters >127 in FlashVars with php urlencode ? _marabout_ ActionScript 1.0 (and below) 15 05-11-2004 08:12 AM

All times are GMT. The time now is 11:23 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.