Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-08-2001, 11:56 AM   #1
elmimmo
Registered User
 
Join Date: Mar 2001
Posts: 3
Question

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";
And then in each button supposed to launch the movie I assign the following action:

Code:
on (release) {
  if (System == "win") {
    fscommand ("exec", "movies\\ShelExec.exe\tmovies\\movie01.mov");
  } else {
    fscommand ("exec", ":movies:movie01");
  }
}
Except that I change the name of each movie to be launched. With this I define the variable "system", publish one of the projectors, and just by redefining it again and publishing the other projector I have both version with minimum hassle. I've tested this and it works.

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);
    }
}
and in each button I changed the action defined simply to:

Code:
on (release) {
    LaunchMovie (movie01, mov);
}
I've tried this only on Mac OS for the moment (that's why the variable "System" is defined as "mac") but it does not work any more. Any help, pleeease?

elmimmo
elmimmo is offline   Reply With Quote
Old 03-10-2001, 12:55 AM   #2
axel
Registered User
 
Join Date: Mar 2001
Location: Szczecin, Poland
Posts: 6
Default

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

axel is offline   Reply With Quote
Old 03-10-2001, 05:32 AM   #3
dnalogic
Unregistered User
 
Join Date: Feb 2001
Location: UK
Posts: 27
Default

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.
dnalogic is offline   Reply With Quote
Old 03-12-2001, 09:53 AM   #4
elmimmo
Registered User
 
Join Date: Mar 2001
Posts: 3
Unhappy

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).
elmimmo is offline   Reply With Quote
Old 03-12-2001, 11:24 AM   #5
axel
Registered User
 
Join Date: Mar 2001
Location: Szczecin, Poland
Posts: 6
Default

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");
}
axel is offline   Reply With Quote
Old 03-12-2001, 12:57 PM   #6
elmimmo
Registered User
 
Join Date: Mar 2001
Posts: 3
Talking

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
elmimmo 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 Off
HTML code is Off

Forum Jump

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


All times are GMT. The time now is 10:41 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, 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.