This content has been marked as final.
Show 12 replies
-
1. Re: getURL AFTER movie plays
abeall Jan 23, 2007 4:14 PM (in response to ivanarias)> is there a way for it to know that the video is playing and not launch the getURL
> until it's done?
How are you actually playing the video? You would use NetStream.onStatus to determine when an .flv is done playing. Look it up in the docs, and report back if you have trouble implementing it. -
2. Re: getURL AFTER movie plays
ivanarias Jan 23, 2007 4:41 PM (in response to ivanarias)How am I playing it? I opened up a New Flash Document in Macromedia Flash Professional 8. I did a File > Import Video and then specified the .flv file and opted for 'Progressive Download for a Web Server' option. It processed that and I had a video on the stage, that's it.
Then File > Export Movie creates a .swf file that apparently automatically calls and plays the .flv file. I didn't add any code or actions or anything and it plays.
Does that tell you how I'm playing the video or might I be leaving something out?
I looked up NetStream.onStatus but I don't know code and it's pretty Greek to me...what exactly am I supposed to do to get it to do a getURL action after the movie has played? I'm not even sure where the code would go, like on which frame...within the same scene where the video is playing I assume?
For comparison on ease of use, the swishvideo program I was using has a toggle button on the export options that you just click and then type in the URL you want launched, so this is pretty far removed for me in terms of complexity... -
3. Re: getURL AFTER movie plays
abeall Jan 24, 2007 11:58 AM (in response to ivanarias)Yes, that does tell me how you are playing it. The result of that process will create an instance of a FLV playback component of some type, and automatically set the compontent to load your FLV. You should click on the component, see what its called in the Properties panel, then look it up in the docs Component Reference. I know that the Media Display component has a 'complete' event, something like this:
function complete(eventObj) {
getURL(' http://etc');
};
myMedia.addEventListener("complete", this);
You would put that actionscript on a frame that the media display exists on. Then just make sure your component has a name of myMedia, or whatever.
I'm not sure if importing the way you have uses the Media Display, it might use a different FLV component, that's just one example. -
4. Re: getURL AFTER movie plays
zensoldier Jan 24, 2007 3:00 PM (in response to ivanarias)Here ya go
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
//whatever you want to happen when it is complete
}
playbackControl.addEventListener("complete", listenerObject); -
5. Re: getURL AFTER movie plays
ivanarias Jan 26, 2007 1:24 AM (in response to zensoldier)I'm doing something wrong -- though I admit I barely understand what you're saying (that's how novice I am!); anyway, I've got this:
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
getURL('splash.htm');
}
playbackControl.addEventListener("complete",listenerObject);
I stuck that in the script box after clicking on the first frame of the timeline. The Component, by the way, appears to be called FLVPlayback I believe. It plays the video no problem which is the good news, but nothing happens at the end (the getURL that I want it to find).
Can someone break this down for me in idiot terms? I barely know where or what the script box is, let alone looking up component references and what media display even refers to. -
6. Re: getURL AFTER movie plays
abeall Jan 26, 2007 8:17 AM (in response to ivanarias)Sounds like you put the code in the right place. But the key here is to make sure your component has a name. Click on the FLVPlayback component, look in the Properties panel, and there should be an input field in the top left, with a default value of <instance name> faded out in grey. This is where you define a name. You can choose a name, but avoid using spaces or any special characters. The above example assumes you have given it the name "playbackControl", in this line of code:
playbackControl.addEventListener("complete",listenerObject);
Let's say you gave the component an instance name of "myVideo_flv". That line would have to change to:
myVideo_flv.addEventListener("complete",listenerObject);
Hope that helps. -
7. Re: getURL AFTER movie plays
ivanarias Jan 26, 2007 10:13 AM (in response to abeall)Thank you! That's the kind of breakdown I need to understand it; only thing now I went back and changed that (stupidly, I hadn't saved the previous project) and this time when I play the resulting .swf back, the code is written across the video screen so I guess I put the text on the screen somehow? Any idea what the hell I just did? LOL -
8. Re: getURL AFTER movie plays
ivanarias Jan 26, 2007 10:26 AM (in response to ivanarias)Okay, disregard that previous message about the text, I just started over and that's good now. -
9. Re: getURL AFTER movie plays
ivanarias Jan 26, 2007 10:43 AM (in response to ivanarias)Okay, I think I got it -- it's working locally now for the first time! It's not working online though, I thought I'd already uploaded all the relevant files but maybe not so I'm redoing it now.
One thing though, I notice when inserting the .swf onto a page in Dreamweaver, the SRC lists the local path for the .fla file -- does the .fla file also need to be saved within the website folder? I thought that was just the project file, akin to saving the .psd file for a Photoshop project when all you want is a resultant .jpg or something to go on the website...? -
10. Re: getURL AFTER movie plays
ivanarias Jan 26, 2007 10:43 AM (in response to ivanarias)Okay, I think I got it -- it's working locally now for the first time! It's not working online though, I thought I'd already uploaded all the relevant files but maybe not so I'm redoing it now.
One thing though, I notice when inserting the .swf onto a page in Dreamweaver, the SRC lists the local path for the .fla file -- does the .fla file also need to be saved within the website folder? I thought that was just the project file, akin to saving the .psd file for a Photoshop project when all you want is a resultant .jpg or something to go on the website...? -
11. Re: getURL AFTER movie plays
ivanarias Jan 26, 2007 10:55 AM (in response to ivanarias)Well, it's working locally but not on the website. Any idea what I could be overlooking? I mean I assume it has to do with the source .flv or relative/absolute paths, but everything seems fine... -
12. Re: getURL AFTER movie plays
abeall Jan 26, 2007 11:03 AM (in response to ivanarias)What doesn't work online? Does the FLV play at all?
You will need the .flv and probably 2 .swfs. One .swf will be the FLVPlayback skin, the other will be your movie. You are right, you won't need the .fla. I am not familiar with DW, how did you embed the .swf?