Hello Everyone,

So here's what I got so far:

/*_root.requireVersion = '9';
_root.redirectURL = 'http://www.unfocus.com';
_root.useExpressInstall = 'true';
_root.documentTitle = "foo bar";
_root.movieSrc = 'movie.swf';
_root.playerType = "PlugIn";
*/
var playerVersion:Number = parseInt(System.capabilities.version.split('
')[1]);

// clean the flashvars
_root.requireVersion = (typeof _root.requireVersion !=
"undefined")?parseInt(_root.requireVersion):0;
if (typeof _root.redirectURL != "undefined")
    _root.redirectURL = new String(_root.redirectURL);
_root.useExpressInstall = _root.useExpressInstall == "true"?true:false;
if (typeof _root.documentTitle != "undefined")
    _root.documentTitle = new String(_root.documentTitle);
if (typeof _root.playerType != 'undefined')
    _root.playerType = new String(_root.playerType);

trace('Checking Version');
// determine if Express Install is necessary:
if (
    _root.useExpressInstall &&
    playerVersion < _root.requireVersion &&
    _root.redirectURL &&
    _root.documentTitle &&
    _root.playerType
) {
    trace('Express Install Started');
   
    System.security.allowDomain("fpdownload.macromedia.com");
   
    _root.installStatus = function(status)
    {
        switch (status) {
            //case "Download.Complete":
                // Express Install worked. There's really nothing to do
here.
                //break;
            case "Download.Cancelled":
                // User chose not to Express Install new Flash version
            case "Download.Failed":
                // The Download failed for some reason, so kick out
message to javascript
                sendEIResults(status);
                break;
        }
    }
    //var updateClip:MovieClip;
   
    _root.createEmptyMovieClip('updateClip', _root.getNextHighestDepth());
   
    updateClipOnLoad = function()
    {
        trace('checking');
        if (typeof updateClip.startUpdate == 'function') {
            clearInterval(updateInterval);
            trace('Express Install SWF Loaded');
            updateClip.redirectURL = _root.redirectURL;
            //updateClip.MMplayerType = _root.playerType;
            updateClip.MMplayerType = "PlugIn";
            updateClip.MMdoctitle = _root.documentTitle;
            updateClip.startUpdate();
        }
    };
   
    updateClip.loadMovie (
       
"http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+Math.random()
    );
   
    var updateInterval:Number = setInterval(updateClipOnLoad, 20);
   
}
else if (typeof _root.movieSrc == 'string') // load content
{
    trace('loading content');
    _root.loadMovie(_root.movieSrc);
}
else // complete breakdown (probably left out a variable)
{
    trace(typeof _root.movieSrc);
    trace('complete breakdown: misconfiguration');
    /* probably do some kind of javascript communication here
    and let javascript turn off the movie, and use whatever
    non-flash content was specified there.*/
    var EIResultsMSg:String = 'Misconfiguration';
    sendEIResults(EIResultsMSg);
   
    var intervalID = setInterval('SendEIResultsBackup', 200, EIResultsMSg);
   
    _root.unFocusShimMsgConfirm = false;
    _root.watch('unFocusShimMsgConfirm', function(prop, oldVal, newVal,
intervalID) {
        clearInterval(intervalID);
        return newValue;
    }, intervalID);
   
}

// this isn't all worked out yet
function sendEIResults(result:String):Void
{
    // this should respond through swfRef.SetVariable - setting
    // unFocusShimMsgConfirm to true;
    fscommand('unFocusShim.EIResults', result);
}
// fscommand doesn't always work, so we do a backup with this in that case
function sendIERsultsBackup(result:String):Void
{
    getURL('javascript:unFocus.Shim.EIRsultsMsg("'+results+'")');
    // :TODO: turn on generic English message as a final backup plan:
}


I still have no idea how I'm going to forward Flashvars on, but I'm
having a rather odd issue with the ExpressInstall. Everytime I run this,
it installs the ActiveX version instead of the PlugIn version of the
player, even though I have hardcoded the thing to "PlugIn". Can anyone
see what might be causing that?

Just a note, this is still a work in progress, I'm aware that it needs
quite a bit of cleanup. ;-)

Thanks,

Kevin N.



Kevin Newman wrote:
> Hey All,
>
> I'd like to be able to simulate the flashvars behavior when I load up
> a swf through loadMovie, so when the swf begins to play, it has access
> to the flashvars set by the loading swf. I'd like to do this without
> using a query string (movie.swf?flashvar1=foo&bar=etc) because using a
> query string has server side and bandwidth implications that I would
> like to avoid.
>
> Is there anyway to simulate that?
>
> If anyone is interested, I intend to use this information to create a
> shim swf that will do the following:
> * provide express install support (I still need to look more closely
> at the express install docs to see what's possible here)
> * will work for the satay embed method to enable loading progress
> bars, without losing flashvars
> * work to speed up PatentMagic (and ObjectSwap too), also without
> losing flashvars
> * load forward version swfs (Actionscript 3.0 based swfs - I'm pretty
> sure I read that this is possible)
> * anything else that comes up that might be useful.
>
> Thanks,
>
> Kevin N.
>
>
>
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
>


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to