This may be a simple question but not sure how to do it.
I have purchased a video player that derives all its code from external .as files (stored in com/flashaman/Videoplayer.as). Problem is that it's designed to be for a single video file where I would like to use multiple instances of the player in various areas of my flash file.
I tried something similar, it worked, but not flawlessly. My class constructor was called twice, and the first time it didn't register the variables in my Flash file, but it did the next time. Why that happened, is because the .as file was loaded BEFORE the Flash file's content.
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Thanks for the suggestions thus far - I have created new projects to play with the methods discussed, however to make things more challenging the Videoplayer class discussed above is not instantiated through a constructor, rather through linking a symbol (movie clip) to the class. The instantiation is made when you place that symbol on the stage and hit that frame. From what I've read you can't pass parameters into this class. Any ideas on this?
No, this didn't do it. Comes up with error "1120: Access of undefined property mcVideoPlayer". Because I'm not creating an instance of mcVideoplayer (it's being created through a symbol that's linked to the class) I can't reference it.
Wow, freaking awesome! Thanks arkitx... I've been going at this for nearly a week!! The problem was that the MovieClip didn't have an instance name, so it wasn't being referenced. So placing this MC on the stage is what is creating the instance of the class right?
Final question - if I wanted to include a back button on the video player that jumped to a different scene "MainMenu" how would I go about that? I could create the button as an additional component in the video player scene which would both call the 'video finished' function and then jump scene, but it would be nice to call the function from within the class. I could then pass a variable into the class such as what scene I want it to jump to. I've tried this...
Actionscript Code:
this.gotoAndPlay(0, "MainMenu");
...from within the class but it doesn't work. Any ideas on this?
Thanks arkitx, working fine now. Do you know why the video would be starting to play prior to it showing on screen? You can hear it playing, but you can't see anything. Depending on the size of the video I'm loading it can be anywhere from 0.2 of a second to over a second.