PDA

View Full Version : Flash MX 2004 - Projector - GetURL - Mac


wyclef
05-06-2005, 08:41 PM
Anyone have any trouble with getURL working with projector files on Mac OS X? Specifically in Firefox? I can only get it to work if I set my default browser to Internet Explorer.

obsoleteasian
06-16-2005, 02:31 AM
im having the same issue. i can get IE to pop relative getURL's but firefox you have to click it once which brings an empty page than a 2nd time for it to actually load.

Madamecito
09-22-2005, 06:08 AM
I've been looking for information about it too.. it seems like if you use getURL to load a relative document in a projector, if you have firefox as your default browser it won't work unless you already have firefox open somewhere in the background.

If firefox is open, getURL works fine... if the projector actually has to open the program to bring up the link, for some reason it sticks an http:// in there which means it can't find the file.

Annoying. IE doesn't seem to have the same problem.

Can anyone shed any light on that??

jmmygoggle
10-04-2005, 07:22 AM
This seems to come down to requiring absolute system URLs for the particular files you're trying to access using getURL. This isn't very flexible but would work in those cases where you can feed an install path to flash or know for certain where a single user or small set of users will install or run your projector from.


getURL("C:/yourproject/readme.html");


I believe that IE, with its file system Explorer hooks, is able to figure out the location from the projector location but Mozilla/Firefox needs the local absolute file paths otherwise it assumes it's a URL and fails. Having used the absolute path I've also noticed that in my case the projector always launches IE rather than my default browser Firefox.

I'm actually having a heck of a time just trying to figure out a consistent way to launch all links from my projector in a new browser window. Should be a simple:

getURL("http://newsite.com", "_blank")


But because it is a projector, when I make IE my default browser for testing purposes, IE simply replaces the current browser window content with the getURL destination. Javascript window.open solutions seem to be even more complicated and cause problems with XP Service Pack 2 etc. and [object Window] blank window errors.

Projectors and dealing with swfs outside of HTML seem to have an entirely different set rules for many behaviors. I wish I could find a FAQ on this and other items including limitations, browser interaction and more recent Windows and Flash security issues.

clindahl
10-07-2005, 10:10 PM
All:

A friend of mine who knows ActionScript pretty well has written a function which generates an absolute path from a relative path if utilized in the "getURL" function.

Example:

getURL(makeAbs("somepath"somefile.html"),"anewwindow")

It does this by grabbing the file path of the Projector file and then stripping off the filename of the projector.

I'm testing this right now and will post if there's interest. My friend also made it cross-platform: if it detects a ":" (colon) in the directory name it assumes a Mac platform, otherwise it leaves the pathname alone.

Anyone find another potential solution?

Charlie

OttoM
10-08-2005, 10:14 AM
Hello Charlie,

please would you be so kind to post your friend's makeAbs-function here?
This Firefox-getURL-problem is driving me crazy since weeks.
There is the same issue with flash-projector-files (.exe) on Windows-PCs.

Best regards
Otto.

P.S.:
Could you send me this makeAbs-function by e-mail, too?
Mailto: info@lernspiele.at

OttoM
10-08-2005, 11:22 PM
I have just programmed the following Work-around:

on (press) {
poslastslash = this._url.lastIndexOf("\\");
if (poslastslash == -1) {
poslastslash = this._url.lastIndexOf("/");
}
folderurl = this._url.substr(0, poslastslash+1);
poscolon = folderurl.indexOf("|");
if (poscolon<>-1) {
folderurlstart = folderurl.substr(0, poscolon);
folderurlend = folderurl.substr(poscolon+1);
folderurl = folderurlstart+":"+folderurlend;
}
targeturl = folderurl+"mywanted.html";
getURL(targeturl, "_blank");
}

Just replace "mywanted.html" with the requested filename!

I have successfully tested this work-around on the web and locally on my Windows-PC: It works fine on both, the IE and Mozilla Firefox, and it covers all the possibilities to start the flash: via .swf, .html and .exe

Could anyone test it in a projector-file on a Mac, too?
If so, please tell me the results.

Best regards
Otto.

clindahl
10-10-2005, 11:21 PM
Here's the absURL.as so far.


//
// absURL function: create an absolute pathname
//
// Original: Mitch Geller
// Modified: Charlie Lindahl, Texas A&M Health Science Center
//
// TRACE statements used during debugging via "Test Movie"
// (outputs to the "output" window in Flash Professional)
//

// Test for being on a Mac (unused so far)
//
function isMac(){
trace(getVersion());
if ( substring(getVersion (),0,3) == "MAC"){
return true;
}else{
return false;
}
}

//
// Get the directory path of the movie
//
// TRACE statements for debugging in "Test Movie"
//
function getDirectoryPath(){
var delim = "/";
var newURL = _url;
trace('Original URL: ' + newURL);
newURL = newURL.substr(0,newURL.lastIndexOf(delim)+1);
trace('Next opURL: ' + newURL);
slashespos = newURL.indexof("///");
newURL = newURL.substr(0,slashespos+3) +
"Volumes/" +
newURL.substr(slashespos+3);
trace('Final URL: ' + newURL);
return newURL;
}


function getAbs(fileName){
var path = getDirectoryPath() + fileName;
trace(path);
this.pathDisplay.text = "Absolute Path: \n" + path;
getUrl(path);
}

// Example (assume "testfile.html" is in the same
// directory as the movie file).
//
//getAbs("testfile.html");


It STILL doesn't work well on the Mac. Works with Safari, but NOT with Mozilla or FireFox or Mozilla or IE on the Mac; haven't tried it on the Pee Cee yet.

Another weirdness: the original function my friend sent me (similar to the
other solution posted in this thread) yielded:

file:///<volume-name>/<toplevel-directory>/index.html

And it NEEDS to be

file:///Volumes/<volume-name>/<toplevel-directory>/index.html

So that's in the function I've got so far.

I am going to have to find another approach I think.

One thing I'm playing with is:
1) Detect that I'm on a Mac (OSX). This is a standard actionscript function
2) Invoke an Applescript to fire off the browser.

To use absUrl.as :

1) Created a dummy keyframe, named it "script".
2) Used a "#include absURL.as"
3) Put the "absURL.as" in the same directory as the "swf" movie.
4) When I generate the Projector it'll automagically include
the function in the resultant executable.

Good luck. I'll keep working on this 'cuz it is the last thing keeping
me from finishing this CD project (oh, yes, that's another
wrinkle to my problem).

rscarbrough
10-21-2005, 08:48 PM
Thank You Dr. Otto!

Your advice and the accompanying script was brilliant! I was having the same problem getting a local link to load from an exe into Mozilla. I had burned a CD with an autorun.inf calling the projector, which loads the menu.htm with the getURL and then the exe does an fscommand-quit while the web page loads from the CD Bless you!!! Bless your house, and your ride, and the people in them too. Thanks for showing my applications "the True Path".

Peace,

R Scarbrough
Memeticist

wyclef
05-01-2006, 10:36 PM
So what's the final verdict with using getURL on projector files to open URLS on the web in a browser?

zurich
05-05-2006, 09:05 PM
I tried OttoM's code. It launches the browser (OSX Firefox) but does not go to a specific url - I must be doing something wrong. Otto could you please revise the code to go to a specifc web page so I can look at what I may be doing wrong?

-Lee

printelectric
05-31-2006, 05:25 AM
Hello all. I'm experience this issue with Flash projectors and Firefox, but only on the Mac platform. Does anyone know what is causing the issue?

I have a Flash project that is being released on CD in just a few days, and I really would like to get this resolved. For my clients' market, they can live without this specific OS / browser combination. But I'm personally disappointed that my favorite browser, on my favorite platform, is the one that's having issues. I've checked all of the known issues and FAQ's at both Adobe and Mozilla, and they aren't offering any solutions that I'm aware of. If there's something I've missed, please let me know.

Best and TIA -

Scott Benton
scott - at - printelectric - dot - com

printelectric
05-31-2006, 05:33 AM
Hey all -

I'm having the same getURL issue, only with FireFox, and only on the Mac platform. I should be clear that I'm only referencing absolute URLs (ie: http://www.printelectric.com/) -

so...


somelink.onRelease = function {
getURL('http://www.someurl.com/', '_blank');
};
[/CODE

Works finee for IE, Firefox, and Netscape on PC, and on Safari / IE on Mac. FireFox launches a blank window, but doesn't load anything.

I have a Flash CD that is due to be released to the replicator in a few days (June 1 if I'm lucky) - and I'd really like to get this resolved. I just feel personally disappointed that my favorite browser, on my favorite platform, is going to choke on one of my best projects. But at this point, I don't see an alternative. My client can live without this specific OS / browser combo, but it reallty bugs me.

I've checked FAQs and known issues at both Adobe and Mozilla with no luck, as well as searching numerous posts here and elsewhere. If there's anything I've missed, please let me know.

Best and TIA,
Scott Benton

scott - at - printelectric - dot - com

PS - if anyone can tell me why my [CODE] tags aren't working, that would also be appreciated.

preston7
11-16-2006, 10:09 PM
i found a pretty easy fix to this problem, just in case anyone cares:

before exporting the mac projector, instead of getURL use fscommand to call up an Applescript stand-alone application that calls up the url.
you will have to include the file into an folder called "fscommand". make sure you include the ".app" extension if you're creating the flash on pc.

best of luck.

preston

Nutbolt
04-01-2007, 12:16 PM
i found a pretty easy fix to this problem, just in case anyone cares:

before exporting the mac projector, instead of getURL use fscommand to call up an Applescript stand-alone application that calls up the url.
you will have to include the file into an folder called "fscommand". make sure you include the ".app" extension if you're creating the flash on pc.

best of luck.

preston

Can you tell me if this will work cross platform, please? Isn't applescript just for the OS platform??

Regards

Severiaan
04-11-2007, 10:19 AM
It may be cross platform if you use check for MAC and then use this solution, on other platforms use getURL ilke it was designed to.

nikinicole
12-07-2007, 05:57 PM
Thank you so much Otto. You just saved my graduation portfolio.