1 Replies - 1024 Views - Last Post: 05 February 2011 - 01:39 PM

#1 stunningstylez  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 03-January 11

Parent SWF to a Child SWF

Posted 04 February 2011 - 11:10 AM

I have been successful with passing variables from html to a flash movie by using flashVars; however, I need these variables to be passed to multiple flash (swf) movies. In particular, they need to be passed to a child swf from a parent swf. I have done some research and have learned that the only way to do this in AS3 is by creating a class. I have been successful at creating the class and using it to import a variable into a swf; however, the variable was set directly in the .as file to a specific value (example: public static var userID = 21;). The variable needs to be a user id so the .as file has to look something like (example: public static var userID = phpID;). What I now need to do is somehow import these php variables into the .as file instead of the .swf file if that is possible. If anybody knows how to do this or has a different solution to solve my problem, any help would be greatly appreciated.

Here is the code that I have so far in the .as file:

package  {
    
    public class idClass {

            public static var flashVars=this.loaderInfo.parameters;
            public static var flashID=flashVars.PHPid;
              
        public function idClass() {
   
        }
    }  
}




Is This A Good Question/Topic? 0
  • +

Replies To: Parent SWF to a Child SWF

#2 chinchang  Icon User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 725
  • Joined: 22-December 08

Re: Parent SWF to a Child SWF

Posted 05 February 2011 - 01:39 PM

What do you mean by 'php variables' ?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1