dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: FSCommand and getURL Bug in Flash Player 9

  1. #1
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766

    FSCommand and getURL Bug in Flash Player 9

    I've been seeing people complain about strange problems with FSCommands and getURL calls for a while now but it wasn't until yesterday that it finally bit me and forced me to figure out what was going on. It turned out to be a bug in the Flash 9 player. If you're using Flash CS3 or Flex and targeting the Flash 9 player then you need to read this...

    FSCommand and getURL Bug in Flash Player 9

  2. #2
    BuenaLlave
    Join Date
    Sep 2000
    Location
    Wasatch Front - Utah
    Posts
    34

    Stand Alone issues

    Hello Northcode,

    i Have a CD for a one of our online courses with the following code:



    stop();
    var xmlLocation:String = new String("menu.xml");
    var contentXml:XML = new XML();
    var mike:Number = new Number();
    var lessonName:Array = new Array();
    var desc:Array = new Array();
    var link:Array = new Array();
    var lessondesc:Array = new Array();
    var bgColor = new Color(topColor);
    contentXml.ignoreWhite = true;
    contentXml.onLoad = loadXML;
    contentXml.load(xmlLocation);
    // launch_btn.enabled = false;
    // launch_btn._alpha = 50;
    function loadXML(loaded) {
    if (loaded) {
    mike = this.firstChild.childNodes.length;
    for (h=0; h<mike; h++) {
    lessonName[h] = this.firstChild.childNodes[h].childNodes[0].firstChild.nodeValue;
    desc[h] = this.firstChild.childNodes[h].childNodes[1].firstChild.nodeValue;
    link[h] = this.firstChild.childNodes[h].childNodes[2].firstChild.nodeValue;
    lessondesc[h] = this.firstChild.childNodes[h].childNodes[3].firstChild.nodeValue;
    }
    atri = this.firstChild.attributes;
    launch_btn.btnLabel.text = "Launch";
    loadIt();
    } else {
    trace("The XML page '"+xmlLocation+"' is missing.");
    courseName.text = "XML LOADING ERROR";
    lessonTxt.text = "";
    launch_btn.btnLabel.text = "Reload XML";
    launch_btn.onRelease = function() {
    contentXml.ignoreWhite = true;
    contentXml.onLoad = loadXML;
    contentXml.load(xmlLocation);
    };
    }
    }
    function loadIt() {
    courseName.text = atri.menuText;
    titleBox.text = lessonName[0];
    descBox.text = desc[0];
    // comment out next line to show instructions on start up ------------------------>>>
    //lessondescBox.text = lessonsDesc[0];
    // populate listbox
    for (i=0; i<mike; i++) {
    myListBox.addItem(lessonName[i]);
    }
    // program Launch button
    launch_btn.onRelease = function() {
    SmartExec(link[myListBox.selectedIndex]);
    };
    }
    // determining if end user is on a mac or pc
    // opening a script.app or .exe file that is calling a .bat that will open the target application
    function SmartExec(target) {
    //getURL("webpages/" +target+".html");
    platform = _root.$version.slice(0, 3);
    if (platform == "WIN") {
    fscommand("exec", target+".exe");
    } else {
    fscommand("exec", target);
    }
    }



    With CS3 the function "Smart Exec(target)" now only works for the PC and the MAC fscommand no longer opens the correct projector file from the fscommand folder.

    Does this have to do with the fscommand BUG? Or does CS3 no longer like referring to the fscommand folder? Remember the issues are only associated with the new intel Macs.

  3. #3
    BuenaLlave
    Join Date
    Sep 2000
    Location
    Wasatch Front - Utah
    Posts
    34
    Also, the solution of call a .bat no longer worked either that is why I commented it out and replaced it with "platform = _root.$version.slice(0,3);"

    It worked like a charm until we upgraded to CS3. If I do not republish (from flash) then the old CDs work which tells me it is not the new intel but rather the way CS3 is publishing its projector files????

  4. #4
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    If you're using SmartExec to launch an AppleScript file, that no longer works (same as BAT files on Windows).

    I've actually been given the source code for Fire-Up by the guys at Atomik Software and I'm going to be releasing an updated version of their tool for the Mac (and PC) once I have the time to dig in and fix it.

    Conquering FSCommand EXEC Part1 : Proxy contains the info you need to get your BAT files working on Windows again.

  5. #5
    BuenaLlave
    Join Date
    Sep 2000
    Location
    Wasatch Front - Utah
    Posts
    34
    I was using SmartExec to launch a applescript file; however, as stated above, that was no longer working. Therefore, I changed the last section of code to simply check to see if the user is on a mac or pc "platform = _root.$version.slice(0,3);" and if they are on a pc it is using fscommand("exec", target +".exe") target being whatever they selected from the list component to open the flash .exe file

    e.g. the user selects a lesson number and then clicks the "launch'' button to launch their selected lesson.

    launch_btn.onRelease = function() {
    SmartExec(link[myListBox.selectedIndex]);
    };


    if it is not a pc then the code ("exec", target) refers to the fscommand folder and whatever target name the user selected from the list box (this should open the projector file). I tried adding ("exec", target+".app") but that doesn't work either. Shouldn't it?

    I will take a look at your link to get BAT files working again. But a solution for the mac and applescript files. Will your commercial app address some of these executable issues or give me other ways of launching .exe and .app files from a standalone player?

  6. #6
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    If you compile the AppleScript to an executable it might work, it all depends on where the problem is. On windows, the issue isn't really with Flash but with the applications you're launching. If they don't understand how to handle UNC paths then they won't work. I'm guessing the root problem on the Mac is the same so it would depend on how compiled AppleScripts work.

    The guys at Atomik Software just wanted someone to maintain Fire-Up so that's what I'm going to do. I won't be charging for the new tool, it will be released for FREE when it's ready.

  7. #7
    Junior Member
    Join Date
    May 2008
    Posts
    1
    Hey there, has there been any advancement on the Fire=up application? Or has adobe addressed the CS3/FP9 issue? Am a little stuck on getting a cross platform interface working that will open folders on the CD for browsing etc. Was planning to use fscommand and an applescript for OSX.

  8. #8
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    I haven't had a chance to play with the Fire-Up code, it may be easier just to rewrite this from scratch since it really doesn't have to do much.

  9. #9
    Member
    Join Date
    Oct 2007
    Posts
    50
    Thank you for the link. Very useful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center