November 27th, 2007 . by polyGeek
This is easily the question I get asked the most about video.Maru: how can I put controls on top of the videoWindow?
It’s very easy to do:
- select the videoWindow MovieClip
- Hit the F8 key to convert that to a MovieClip - essentially embedding the videoWindow within another MovieClip
- Give it any symbol and instance name you want
- Make sure that your controls are on a layer above the layer which holds the videoWindow holder - you probably already did this
video.Maru uses recursion to find all the controls so you could nest the videoWindow, or any other control, inside as many MovieClips as you wish and it will still work - provided the control is defined on frame one of the timeline.
The reason that the videoWindow ends up on top of other controls is that the videoWindow gets replaced at runtime with a MovieClip that is embedded in the Library.
MovieClips created at runtime automatically get placed on top of any MovieClips that are on the stage at authoring time. That’s because authoring time MovieClips get a depth starting at -16383. Creating MovieClips at runtime defaults to starting at a depth of 0, above anything on the Stage at authoring time.
Posted by: polyGeek in FAQ, videoWindow |
No Comments »
November 27th, 2007 . by polyGeek
If you didn’t know, the magic ingredient to video.Maru is recursion. And recursion can be a dangerous thing when it isn’t controlled because it leads to infinite loops. But even if it is controlled the Flash player halts after 256 recursive calls because it thinks it has reached an infinite loop.
I wish they would up the number of recursive calls to something around 1024 loops but that’s another story.
Here is the error message you would see if you go over 256 recursions:
256 levels of recursion were exceeded in one action list.
This is probably an infinite loop.
Further execution of actions has been disabled in this movie.
Here’s the simple solution to fixing this if this happens to you while using video.Maru. Simply select everything that is a part of your video player - including the video.Maru SWC - and hit F8 to convert it to a MovieClip. It doesn’t matter what you name the MovieClip and it doesn’t need an instance name.
That should fix everything for you.
The reason for this is that the video.Maru SWC is on the same level with lots of other MovieClips and buttons on your stage. So when video.Maru runs it recursively runs through everything from the level it is on to see if it is a part of the video interface. By placing only the video interface elements into a MovieClip it isolates the rest of your FLA from video.Maru.
An analogy of what’s happening
If you have a site built in Flash you could think of your FLA as a forest. The Stage is like the forest floor and the trees are your MovieClips. And each tree has branches and leaves just like MovieClips have other MovieClips nested inside.
So if you put video.Maru on the forest floor - the Stage - it would recursively try and crawl through every tree in the forest. But your video interface is usually just one specific tree in the forest. So you need to put video.Maru on just that tree. It will now recursively crawl through just that tree but won’t climb down and attempt to crawl through other trees.
Posted by: polyGeek in FAQ |
No Comments »
November 26th, 2007 . by polyGeek
video.Maru now has the ability to respond to cue-points in your Flash videos.
Using this feature is very easy. Just use the videoMaruCreationComplete() event to tell video.Maru which function you want to use as a callback for when a cue point is reached. Then when a video passes over a cue-point it will send that information to your callback.
Below is an example. Look for the text field below the controls to change when a cue point is reached. You could use something like this to initiate changes in your design or display a message to your users.
Here is all the code that is needed to enable the reaction to cue points: ( Download Source )
To add cue points to your video using the Flash Video Encoder just select the Cue Points tab and drag the playhead across to the scene where you want to add a cue point. Then click the “+” button and give the cue point a name. That’s pretty much all there is to it. You could then use a switch () statement in your callback function to perform complex actions or like I did in the example just update a TextField.

Posted by: polyGeek in API, Navigation |
6 Comments »
November 15th, 2007 . by polyGeek
Would you like to play Flash videos on your site and have links to play various different videos in your HTML code?
Here’s how to do it using the Flash player’s External Interface as a bridge between Javascript and Actionscript, which then uses the video.Maru API to switch videos.
Download source here, 1.2 megs with videos.
Delivery
Sky
Cossacks
Here’s what the Actionscript code looks like:
Take a look at the first line of code: System.security.allowDomain(’http://videomaru.com/’). You’ll have to edit that to make it work on your machine. And give the System.security docs a read if you have any problems. I got everything to work by just opening the .htm file locally but that’s not always the case. Sometimes the ExternalInterface doesn’t work unless you are using a hosted file. I’ve wasted many an hour trying to debug when forgetting that little nugget.
And this is all there is to the Javascript:
Posted by: polyGeek in API, ExternalInterface |
7 Comments »