A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: call document class from within embedded swf

  1. #1
    Senior Member
    Join Date
    Nov 2004
    Location
    Amsterdam
    Posts
    212

    call document class from within embedded swf

    Hi,

    I am embedding an swf containing video in my document class like:
    Code:
    [Embed(source="/assets/panorama_video.swf")]
    private var videoAsset:Class;
    
    ...
    
    var videoMat:MovieClipAsset = new videoAsset();
    to use the video in a Papervision3D scene (not important for this).

    How can I tell the document class that the video has completed playing?

    Code in video swf:

    Code:
    player.addEventListener(VideoEvent.COMPLETE, onVideoComplete);
    
    function onVideoComplete(evt:VideoEvent):void{
    	....?
    }
    Can I use dispatchEvent in someway? How can I call a function in the document class from within the embedded swf?

    thanks!

    JerryJ.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Why don't you use the Loader class to load the video? Then you can get to the video by using event.currentTarget.content.player.addEventListene r...
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    Nov 2004
    Location
    Amsterdam
    Posts
    212
    Absolutely right, thanks again :-).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center