Google Product Forums

AS3 API

TaipeiNoodels Jan 20, 2012 2:51 AM
Posted in group: DoubleClick Rich Media

Categories: Studio Flash Components :

Hi I'm trying to get a call function to work once a video has reached the end. I've set up the function name to call on the advanced video player component and added the following code...

videoInstance.addEventListener(StudioEvent.ON_VIDEO_COMPLETE, endVid);

function endVid(event:StudioEvent):void {
back_mc.gotoAndPlay("playEndVid");
}

However when I publish I'm getting these two errors....

1120: Access of underfund property videoInstance.
1119: Access of possibly undefined property ON_VIDEO_COMPLETE through a reference with static type Class.

I've tried both

import com.doubleclick.studio.events.StudioEvent;

and

import com.google.ads.studio.events.StudioEvent;
import com.google.ads.studio.ProxyEnabler;
import com.google.ads.studio.events.VideoEvent;

Am I missing something. I'm not too familiar with AS3. Is there a detailed tutorial on calling a function once a video has completed.

Help on this would be appreciated.