Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error 1120 It shouldn't be this hard. Need some help

Explorer ,
Apr 02, 2013 Apr 02, 2013

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.

TOPICS
ActionScript
506
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Apr 02, 2013 Apr 02, 2013

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.

Translate
Engaged ,
Apr 02, 2013 Apr 02, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 02, 2013 Apr 02, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines