How do I access flashvars if I can't access the stage?

How do I access flashvars if I can't access the stage?

I'm fiddling with the Open Source Media Framework's Strobe Media Playback player, and I'm trying to take a flashvar and put it in the package org.osmf.net.NetNegotiator.

But the netNegotiator class can't access the stage, so I can't do stage.loaderInfo.parameters to get the flashvar.


Alternately, I can get the flashvar from StrobeMediaPlayback.as, but I can't figure out how to send it over there.

I've tried to import the package in the StrobeMediaPlayback.as, but not only does NetNegotiator show up on the predictive typing thing, I get an undefined error when I try to use it.

Answers


You can always make a singleton class, something like SeesionFlashVars.as

package
{
    public class SeesionFlashVars
    {
        public static var flashVars:Object;
    }
}

Now, in your main class you can write the data in the static variable like this:

SessionFlashVars.flashVars = YOUR_OBJECT;

After that you can access the data same way in any of your classes.


Does this work?

var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;

for (keyStr in paramObj) {
  valueStr = String(paramObj[keyStr]);
  tf.appendText("\t" + keyStr + ":\t" + valueStr + "\n");
}

Need Your Help

How to retrieve contact details from custom account?

android android-contacts android-syncadapter

I've created an android app with my custom account type.The account type shows in Accounts & Sync settings and all my contacts sync from own server to my phone works normally.

Xquery: Dividing the attribute value by spaces

xpath xquery database xpath-2.0

So I'm trying to get the country codes of this river.