dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Variables from php

  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    45

    Variables from php

    Hi,

    I have a swf file embedded in a php file. In the file, I am declaring a couple of variables in php. Is there any simple method of reading these variables into actionscript variables?

    Cheers.

  2. #2
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    you could look at using the flashvars parameter in your embedded swf code, check this http://www.macromedia.com/support/fl.../flashvars.htm

  3. #3
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Depends on when you're reading the variables in. On load? After a user does something with the Flash movie?

    If it's on load, you can use php to embed the file with the variables

    Code:
    print "<embed src=\"flashMovie.swf?var1=$phpVar1&var2=$phpVar2\" height=\"100\" width=\"200\">";
    In this example, you're passing your PHP variables named phpVar1 and phpVar2 into Flash, where they would be named var1 and var2, which you could then use as you wanted.
    Last edited by rdoyle720; 12-03-2003 at 07:05 PM.

  4. #4
    Member
    Join Date
    Feb 2003
    Posts
    45
    That is exactly what im looking for. cheers guys.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center