Anyone who might be following,

It seems kind of silly, but you have to use MMplayerType to pass in the
player Type instead of using your own variable name.

>From the Adobe Flash Detection Kit:

function loadComplete()
{
    loaderClip.redirectURL = _root.MMredirectURL;
    loaderClip.MMplayerType = _root.MMplayerType;
    loaderClip.MMdoctitle = _root.MMdoctitle;
    loaderClip.startUpdate();
}

At least the second line within the function (playerType) doesn't seem
to do anything, as the update movie that is downloaded from the
macromedia address, seems to use _root.MMplayerType no matter what you
set the above to (and it seems to default to ActiveX if you don't have
_root.MMplayerType set).

I guess someone hard coded _root.MMplayerType, instead of using the one
that's set above. Oh well, I guess I'll just use those MM* variable
names. :-)

This is actually promising for the original question of this post -
maybe flashvars are automatically available to loaded swfs? I'll test
and let you know what I find.

Thanks,

Kevin N.



Kevin Newman wrote:
> 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:
>   




_______________________________________________
[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