View Full Version : two questions on actionscript
Jaycee 06-04-2003, 05:53 PM Firstly, I was wondering...i understand the Load movie option where you take an external swf and load it into a movieholder....the question is...how would I go about initially having a movie loaded when my page comes up without them first having to press a button? Secondly, do you know how when someone clicks on my email address in Flash how it could bring up their mail browser? I knkow how to do it in javacript but I assume they have this funtion somehow in Flash? I apologize cause i'm a bit of a beginner but hopefully this makes sense. Thanks in advance!
|
|
DainBramaged
06-04-2003, 09:11 PM
Well, the mail part is simple. On your button, put this code:
on (release) {
getURL("mailto: you@yourdomain.com");
}
replacing the you@yourdomain.com with a real e-mail address.
And for the first question:
Flash's default behavior is to play whatever is in the timeline. So if you want a particular section to automatically play when the page loads, just put it in your main timeline. If you want to keep it a separate swf and just automatically load at a particular time, you can just use the loadMovie(); command. It doesn't have to be on a button...it can just be an action in the timeline.
Hope that helps.
Dain
Jaycee
06-04-2003, 11:30 PM
For some reason that code didn't work for the contact me....i even copied and pasted the script in expert mode. WEird. ALso, for the other question...i attached a jpeg to illustrate the problem better....thanks again for the help!
DainBramaged
06-05-2003, 03:51 AM
Kinda hard to say what the problem is without seeing the fla. I understand if you don't want to show it, but there are lots of possibilities to speculate upon.
On the upside, hang in there, I KNOW it works....I've done it time and again.
Now, I'm not questioning your choice to do so, but I don't see a real need for the "movie holder". An easy way to load a movie is to duplicate your main movie to get the size and placement correct. Then, when you have the new content created, delete everything except for the new content that is to be the loaded movie. In the main timeline of the movie it will be loaded into, put your loadMovie command. Then you don't have to worry with an extra MC and all the issues that come with it (can be very useful, but not necessary if it's just mucking up the works.) Plus, with MC's you'll have to worry with targetting correctly and MC's have their own coordinates, which could cause you worries. Anyway, you can then use the loaded movie's FLA as a template for the rest of the content--your size/spacing is already set up. When you load a movie, you specify what level to load it into. If you load all your movies into the same level, they will unload the previous movie when the new one loads. Very clean.
If you want to hang onto the Movie Clip "holder" thingy, we can possibly work that out too, but I might have to see the fla to know what the problem is.
Hope this helps.
Dain
edit// I just reread the post and checked the image. If your loadMovie command is in the main timeline, make sure you use the correct path to target your movie clip's instance name and that it actually has an instance name. If the command is on the movie clip itself, make sure it has a clip event handler on it.
eddy-3ddy
06-15-2003, 10:26 AM
try the onload function:
paste this and change it in your first frame of your scene
_root.onLoad = function(){
LoadMovieNum("themovie.swf",1)
}
then it will appear without an action from the user. the "1" in the function is the level. If a other movie has the same level, he will be replaced by the new one.
eddy-3ddy
06-15-2003, 10:28 AM
Oh, and the mail part. it's getURL("mailto:yourmailadress") without the space between mailto: and yourmailadress
CGTalk Moderation
01-15-2006, 08:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.