| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Mar 2001
Posts: 3
|
I am trying to launch quicktime, avi and mpg movies from flash and for this I use 2 techniques, one for windows users and another for mac users. For windows I call one of those programs that call the default executable for a certain document (the movie) that is passed as its arguments (one i'm using is shelexec.exe). For macs I call an applescript with the same name as the movie (without the extension) that calls the movie in question.
In the first place I manually define which system (win or mac) is the projector intended for with an action in the first frame stating: Code:
var System = "mac"; Code:
on (release) {
if (System == "win") {
fscommand ("exec", "movies\\ShelExec.exe\tmovies\\movie01.mov");
} else {
fscommand ("exec", ":movies:movie01");
}
}
Anyhow there are dozens of buttons launching movies so I tried to define the function to launch the movies just once and call it from every button like this: First I changed the action I defined in the first frame to: Code:
var System = "mac";
function LaunchMovie (NameMovie, ExtensionMovie) {
if (System == "win") {
fscommand ("exec", "movies\\ShelExec.exe\tmovies\\" + NameMovie + "." + ExtensionMovie);
} else {
fscommand ("exec", ":movies:" + NameMovie);
}
}
Code:
on (release) {
LaunchMovie (movie01, mov);
}
elmimmo |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Mar 2001
Location: Szczecin, Poland
Posts: 6
|
problem in "adressing"
if you defined this function on main timeline and buttons are inside of a movie clip you should use: on (release) { _root.LaunchMovie (movie01, mov); } in buttons |
|
|
|
|
|
|
|
|
#3 |
|
Unregistered User
Join Date: Feb 2001
Location: UK
Posts: 27
|
Maybe a stupid suggestion, but, have you tried putting the parameters in quotes? they are strings and not objects, afterall.
Old code: Code:
on (release) {
LaunchMovie (movie01, mov);
}
New code: Code:
on (release) {
LaunchMovie("movie01","mov");
}
Regards, Dean Alexandrou. |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Mar 2001
Posts: 3
|
I tried with _root.LaunchMovie writing its parameters with and without quotes, but still no luck.
Maybe I should have pointed that those buttons I assign the action to are in a different scene (but same movie clip) than the first one (the 1st frame of which is where de function is declared). |
|
|
|
|
|
#5 |
|
Registered User
Join Date: Mar 2001
Location: Szczecin, Poland
Posts: 6
|
working for me
![]() where did you defined this function? check it with debug/variables //main timeline var System = "mac"; function LaunchMovie (NameMovie, ExtensionMovie) { trace("XXXXXXXXXXX"); // be sure it is called if (System == "win") { loadMovieNum("movies\\ShelExec.exe\tmovies\\" + NameMovie + "." + ExtensionMovie,2); } else { loadMovieNum(":movies:" + NameMovie,2); } } //button inside movie clip on (release) { _root.LaunchMovie("movie01","mov"); } |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Mar 2001
Posts: 3
|
It works!! I do not really know what I was doing wrong. Probably a bunch of things, mistyping the movies, sometimes trying with projectors sometimes not (and only projectors can launch executables which is what I use)... whatever. THANKS A LOT!.
As my question probably revealed, I am neither programmer nor have touched ActionScript but the surface. This was the 1st time I used the debugger and I saw Flash itself has a predefined "$version" variable, the value of which when debugging in Mac OS is reported as "MAC 5,0,30,0" in my version of Flash. So I saw there is no need for a manual change in a custom "system" variable. So, just two teenie weenie little question more. Could anyone provide me with the value of "$version" in a windows Flash Player (whatever its version number might be). And is there an operator which I can use in the "if" function which would mean $version contains "MAC" instead of &version equals "MAC 5,0,30,0" (so that the movie keeps working even if I upgrade Flash and publish it again) Whether you can answer these also or not, THANKS A LOT again |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Actionscript not calling some Javascript functions in IE | dinkus | ActionScript 1.0 (and below) | 4 | 07-06-2005 02:49 PM |
| Functions only calling in certain order - :( | youknowsit | ActionScript 2.0 | 10 | 03-04-2005 09:02 PM |
| calling functions from other timelines? | mindfriction | ActionScript 1.0 (and below) | 1 | 08-12-2004 03:28 PM |
| SetInterval & calling functions | simonboris | ActionScript 1.0 (and below) | 15 | 12-18-2003 04:20 PM |
| Calling functions btw levels | RealBBoy | ActionScript 1.0 (and below) | 9 | 10-23-2001 03:21 PM |