Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Desktop, Mobile and non-browser Environments > Projectors and CDs

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-06-2005, 08:41 PM   #1
wyclef
She Bangs! She Bangs!
 
Join Date: Jan 2003
Posts: 475
Default Flash MX 2004 - Projector - GetURL - Mac

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.
wyclef is offline   Reply With Quote
Old 06-16-2005, 02:31 AM   #2
obsoleteasian
theSWAK
 
obsoleteasian's Avatar
 
Join Date: Oct 2003
Location: SF Valley, CA
Posts: 25
Send a message via ICQ to obsoleteasian Send a message via AIM to obsoleteasian Send a message via Yahoo to obsoleteasian
Default

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.
obsoleteasian is offline   Reply With Quote
Old 09-22-2005, 06:08 AM   #3
Madamecito
~*^_^*~
 
Madamecito's Avatar
 
Join Date: Sep 2005
Location: Sydney
Posts: 2
Default

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??
Madamecito is offline   Reply With Quote
Old 10-04-2005, 07:22 AM   #4
jmmygoggle
Registered User
 
Join Date: Sep 2005
Posts: 1
Default

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.

ActionScript Code:
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:
ActionScript Code:
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.
jmmygoggle is offline   Reply With Quote
Old 10-07-2005, 10:10 PM   #5
clindahl
Registered User
 
Join Date: Oct 2005
Location: Houston, TX
Posts: 3
Default makeAbs function

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"),"anewwind ow")

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

Last edited by clindahl; 10-07-2005 at 10:11 PM.. Reason: Changed the title from "getAbs" to "makeAbs"
clindahl is offline   Reply With Quote
Old 10-08-2005, 10:14 AM   #6
OttoM
Registered User
 
Join Date: Oct 2005
Posts: 2
Default work-around for the getURL-problem

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 is offline   Reply With Quote
Old 10-08-2005, 11:22 PM   #7
OttoM
Registered User
 
Join Date: Oct 2005
Posts: 2
Default Solution for the getURL-Problem

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.
OttoM is offline   Reply With Quote
Old 10-10-2005, 11:21 PM   #8
clindahl
Registered User
 
Join Date: Oct 2005
Location: Houston, TX
Posts: 3
Default absURL function

Here's the absURL.as so far.

ActionScript Code:
// // 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).
clindahl is offline   Reply With Quote
Old 10-21-2005, 08:48 PM   #9
rscarbrough
Memetic Engineer
 
Join Date: Oct 2005
Location: Louisville, KY
Posts: 1
Send a message via Yahoo to rscarbrough
Thumbs up Blessings on OttoM's house

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
rscarbrough is offline   Reply With Quote
Old 05-01-2006, 10:36 PM   #10
wyclef
She Bangs! She Bangs!
 
Join Date: Jan 2003
Posts: 475
Default

So what's the final verdict with using getURL on projector files to open URLS on the web in a browser?
wyclef is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:59 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.