Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6212099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:27:16+00:00 2026-05-24T06:27:16+00:00

I have an as3 class with an embedded swf. I need the embedded swf

  • 0

I have an as3 class with an embedded swf. I need the embedded swf to dispatch an event and have the as3 class action on that event. This used to work fine when the embedded swf was embedded and had been loaded as an external swf, however now that it’s embedded the listener never picks up on the dispatched event.

I’ve created a simplified example below, the ‘onMovieComplete’ function is never called.

/*  I have an external swf file 'movie.swf' with a simple animation in it.
 *  When the animation hits a frame (frame 70 in this case) it fires a
 *  Event.COMPLETE (using:- "this.dispatchEvent(new Event(Event.COMPLETE));" )
 */

 package {

    public class ExampleSwf extends MovieClip {

        [Embed(source="movie.swf")] private var MovieSwf:Class;

        private var movie:MovieClipAsset;

        public function ExampleSwf() {
            this.addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event):void {
            this.removeEventListener(Event.ADDED_TO_STAGE, init);

            this.movie = new MovieSwf();
            this.addChild(this.movie);
            this.movie.addEventListener(Event.COMPLETE, onMovieComplete);
        }

        private function onMovieComplete(e:Event):void {
            var foo:String = "bar";
        }

    }

 }

Does anyone know why the event dispatched from the embedded swf is never picked up by the listener?

Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:27:18+00:00Added an answer on May 24, 2026 at 6:27 am

    I managed to get this to work by using:

    stage.dispatchEvent(new Event(Event.COMPLETE));
    

    In my embedded movie.swf file, and then in my as3 class using:

    this.movie.stage.addEventListener(Event.COMPLETE, onMovieComplete);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used this code in my AS3 document class to remove all objects
in AS3, I have an external class ImageLoader, that loads an image upon request.
I have a AS3 swf [1] that is loading another AS2 swf [2] which
I have a class which extends the Sprite object in as3. I need to
I have a menu that is built using its own AS3 class, when a
Please help Stackoverflow! I have a MapInterface class in AS3 that inherits from Interface
I have an AS2 swf that is hosted by an AS3 swf and they
I have two AS3 classes, A and B. Class A contains an ArrayCollection that
I have an as3 class that I use for communicating with my Zend_AMF endpoint:
I have as3 class like this package { import Global; import flash.display.MovieClip; import flash.events.*;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.