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 9084349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:58:40+00:00 2026-06-16T20:58:40+00:00

I have an external SWF that I load into a Loader object. I add

  • 0

I have an external SWF that I load into a Loader object.

I add this Loader object as a child to a MovieClip and add this MovieClip to my stage.

I now want to draw a transparent rectangular Sprite on top of the Loader object, that is just needed to catch mouse event.

(I need to know when the mouse rolled over and rolled out of the transparent layer).

.

If you’re asking yourself – why do I need this transparent layer and not just catch the events on the Loader itself ? well, there are a lot of reasons for this, most of them have to do with the client requests, but also – because some externally loaded SWFs don’t respond to the mouse events for some reason – so I need to ‘trick’ it and add my own transparent layer on top.

My problem is –
if I put the transparent layer as a child of the MovieClip that holds the Loader, then I get this hirarchy:
enter image description here

problem is – mouse events are caught by the top-most layer (the transparent-layer) and passed on to the MovieClip and the Stage.
The events aren’t fired in the Loader object, and so – the SWF becomes non-interactive.

.

The other solution would be –

to somehow add the transparent layer as a child of the Loader object, like this:
enter image description here

then the events would be bubbled up to the Loader and the SWF.
Problem is – Loader class does not allow you to add child elements to it (except for the loaded SWF).

So can anyone offer advice how I can add a transparent layer on top of the SWF and still have mouse interaction with both the transparent layer and the SWF layer ?

  • 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-06-16T20:58:41+00:00Added an answer on June 16, 2026 at 8:58 pm

    The transparent layer is blocking the events of the loaded swf file. You need to use the mouseEnabled property to false for this layer.

    I don’t know if this work for you, but I think that this could be useful. Adds the following code in your main swf.

    import flash.display.Loader;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import fl.transitions.Tween;
    import fl.motion.easing.Linear;
    
    // Disables the mouse interations
    transparentLayer.mouseEnabled = false;
    // Initialize with alpha 0
    transparentLayer.alpha = 0;
    
    // Cretes the loader
    var loader:Loader = new Loader();
    // Listen the complete event
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
    // Loads the external swf files
    loader.load(new URLRequest("swf.swf"));
    // Add in the background
    addChildAt(loader, 0);
    
    // Listen the complete event
    function loadComplete (event:Event) {
        // Add the mouse events to the loaded content
        loader.contentLoaderInfo.content.addEventListener(MouseEvent.ROLL_OVER, mouseHandler);
        loader.contentLoaderInfo.content.addEventListener(MouseEvent.ROLL_OUT, mouseHandler);
    }
    
    // Handles de mouse events of the loaded swf
    function mouseHandler (event:MouseEvent)
    {
        switch (event.type) 
        {
            case MouseEvent.ROLL_OVER :
                // Shows the transparentLayer from the current alpha value to 1 in 1 second
                new Tween(transparentLayer, "alpha", Linear.easeNone, transparentLayer.alpha, 1, 1, true);
            break;
            case MouseEvent.ROLL_OUT :
                // Shows the transparentLayer from the current alpha value to 0 in 1 second
                new Tween(transparentLayer, "alpha", Linear.easeNone, transparentLayer.alpha, 0, 1, true);
            break;
        }
    }
    

    The transparent layer lost all its interations, so you need apply the motion effects externally. Here you can download the project running http://cl.ly/LtfA

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .swf which loads an external .swf: this.createEmptyMovieClip(container_mc, this.getNextHighestDepth()); var my_listener:Object =
I have Javascript that loads external swf, appending tags "object" and "embed" when page
I have an external SWF file that I need to load at runtime. However,
I have to load XML from external domain, so my code looks like this
I have an .swf that I am embedding into HTML using the jQuery SWF
I have a flex application that loads an external swf file. I created the
i have to create SWF that contains only specific parser and load text content
I have external swf (ext.swf) that is loaded in my FlashDevelop as3 project. When
I have a textfile, that is loaded into a swf through a flashvars: The
I have a flash movie instance name headArea I want to load a external

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.