Jump to content
Search Community

VideoLoaderVars missing onInit Event

boogie test
Moderator Tag

Recommended Posts

Hi, I'm loading a video using VideoLoaderVars, but the problem that I have is that there is no onInit() function on VideoLoaderVars object. I don't know if I'm doing something wrong but my idea is to do this:

 

var vars : VideoLoaderVars = new VideoLoaderVars();

vars.onInit(initEvent);

var loader : VideoLoader = new VideoLoader(theUrl, vars);

 

if I don't use the vars object y can get it right:

 

var loader : VideoLoader = new VideoLoader(theUrl,{onInit:initEvent})

 

But I have to parse a lot of parameters so I will like to have the vars object set it up.

 

Is there any work around ?

 

TIA

Link to comment
Share on other sites

try:

 

vars.onInit = initEvent;

 

i haven't tried it on a VideoLoader, or with a VideoLoaderVars object but on a simple tween:

 

import com.greensock.*;

var vars:Object = new Object();
vars.onComplete = test;
vars.x = 200;

TweenLite.to(mc, 1, vars);

function test(){
trace("test");
}

 

that works fine. let me know if it works for you.

 

Carl

Link to comment
Share on other sites

Ok I found the work around :)

Looking at the source code there is a public method call "prop" where you pass property as String and any value, so it will be something like this

 

vars.prop("onInit", onInitEvent);

 

 

And that will do the job !!

 

Now I see the previous replay from GreenSock :)

Thanks and I will download the newest release. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...