Process Variables?

  • JasonStanley
  • Graduate
  • Graduate
  • JasonStanley
  • Posts: 124
  • Loc: London, England

Post 3+ Months Ago

I know very little about actionscript. This should be very very simple.

I have a small space where I basically want to display the flash page and a sentence.

On my stage I have 2 bits of dynamic text. One has an instance name of 'title'. The other has an instance name 'content'.

What I want to do is somehow get 2 variables called 'flashtitle' and 'flashcontent' from my web page into my .swf file. I then want these variables to over write my dynamic text fields.

Where do I put these variables in relation to my flash object?
Can someone give me the actionscript required to take these variables and put them into the 2 instances mentioned above.

Help on this would be very very greatly appreciated.

Jason
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

How are you writing the variables to the page that holds your swf? The code to change whats in a textbox is extremely simple but you need a way to get those variables INTO your swf.

Code: [ Select ]
textfieldinstancename.text = "New Text";
//or
textfieldinstancename.text = variablename;
  1. textfieldinstancename.text = "New Text";
  2. //or
  3. textfieldinstancename.text = variablename;
will set the text

this will help you get the text into flash
http://smartwebby.com/Flash/external_data.asp
  • JasonStanley
  • Graduate
  • Graduate
  • JasonStanley
  • Posts: 124
  • Loc: London, England

Post 3+ Months Ago

Thanks for the help, however I was hoping to be able to get the variables from the webpage itself and not an external file. Is this possible?

If not, is there anyway to use actionscript to get the page it is on. A bit like PHP's $_SERVER['PHP_SELF']. Does this exist in actionscript. I am only using this on 4 pages so if I cannot do it with the above method perhaps I could find out the page with actionscript and then have a switch statement.
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

the easiest way is to load variables into flash at run time using the SWFObject this is a replacement for the embed tag but it also uses some js to pass variables to flash.

add in:
Code: [ Select ]
so.addVariable("VariableName","VariableValue");


Use php or other to modify the variable value and then variable is available in actionscript as _root.VariableName

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 11 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.