Copy link to clipboard
Copied
Hello all.
I am working with AS3 code that was provided by a company to help embed video into their files. Here is the error I get.
1120: Access of undefined property VideoName. |
Here is the code followed by the instructions.
import flash.events.Event;
var _page:Object;
function setBookPage(page:Object):void
{
_page = page;
page.addEventListener("pageOpen", handlePageOpen);
page.addEventListener("pageClose", handlePageClose);
}
function handlePageOpen(e:Event):void
{
VideoName.play(); // to launch video automatically
}
function handlePageClose(e:Event):void
{
VideoName.pause(); // to stop video
}
Click File > Import > Import Video. Import your video’s FLV file to Adobe Flash. After selecting the desired file, select “Load external video with playback component”.
Then you can choose a skin and color for your video.
Enter a file name in Properties/SWF. Note that this name must match the file name used later in the code.
Enter the relative path in the 'Source' field, e.g. just the name of your video file rather than the entire path. This will allow your video to playback properly even if your publication has moved to another location.
At the bottom of the window you can see the timeline. Notice the little black dot on the left side of the timeline. Click on it and press F9.
Copy and paste the following code into the window that appears:
import flash.events.Event;
var _page:Object;
function setBookPage(page:Object):void
{
_page = page;
page.addEventListener("pageOpen", handlePageOpen);
page.addEventListener("pageClose", handlePageClose);
}
function handlePageOpen(e:Event):void
{
VideoName.play(); // to launch video automatically
}
function handlePageClose(e:Event):void
{
VideoName.pause(); // to stop video
}
Close the window.
Click Ctrl+Enter to see a preview. If you edit the project later, save it and click Ctrl+Enter again to update the files.
Any help would be greatly appreciated. I have sent this to the company as well, but no response yet and the deadline is looming.
I am using Flash Professional CS6 to compile the AS.
From looking at the code and reading the instructions it looks to me like they expect you to replace VideoName with the actual name of your video made in this step: Enter a file name in Properties/SWF. Note that this name must match the file name used later in the code.
Copy link to clipboard
Copied
From looking at the code and reading the instructions it looks to me like they expect you to replace VideoName with the actual name of your video made in this step: Enter a file name in Properties/SWF. Note that this name must match the file name used later in the code.
Copy link to clipboard
Copied
I solved the problem. Thank you for triggering what I was doing wrong Nabren. I had the name in there, but had included the .flv file extension, and with all the stress earlier in the day, didn't see it. It seems to work now. Thanks.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now