php - Using flashvar inside actionscript


I am working on a live streaming media platform and have a Flash interface. I need the instance string to be unique to each user profile it sits on. I have the following in my PHP.

var flashvars = {};
flashvars.instance =  escape('<?php $global $user; $drupaluserid = $user->uid?>');

The AS3 is where the string needs to be set, I have this.

private var INSTANCE:String = "default";
public function setInstanceName(inst:String):void{
        INSTANCE = inst;

Not sure how to proceed before I compile the Flash app to grab the flashvar.




In your case you may want to use a Singleton class to be initiated in your main constructor, then Called from anywhere in your code:

// initialize in your doc:
// then call it from anywhere:

Note that this library is not case sensitive to prevent external typo errors.




Flash vars come into your Flash movie asloaderInfo.parameters which is an Object. In your case you would have to write

var instance:String = loaderInfo.parameters.instance;

in your Document Class or main class.

More info here:

People are also looking for solutions to the problem: php - HTML/CSS: Image Not being displayed


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.