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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:36:49+00:00 2026-05-25T14:36:49+00:00

ok so, i wrote this code: import flash.events.Event; import flash.display.MovieClip; import flash.display.Loader; import flash.net.URLRequest;

  • 0

ok so, i wrote this code:

import flash.events.Event;
import flash.display.MovieClip;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.display.Stage;

stop();

var loader:Loader = new Loader();
var defUrlReq = new URLRequest("indexCoontentLoad.swf");
var urlRequest:URLRequest = new URLRequest();
var myLoadedSwf:MovieClip = null;
var swfStage:Stage = this.stage;

/////////////// INITIATE LOADERS /////////////// 

loader.load(defUrlReq);

/////////////// START MAIN HANDLER FUNCTION ///////////////

/////IMPORT DEFAULT SWF /////
loader.contentLoaderInfo.addEventListener(Event.INIT, loadedHandler);
function loadedHandler(event:Event){  

    myLoadedSwf = event.target.content;
    addChild(myLoadedSwf);

    trace(myLoadedSwf);

    myLoadedSwf.gotoAndPlay("intro");
    trace("STEP 1 -- ext def swf loaded");
}
///////END IMPORT. ///////////////


///// START LISTENERS AND THEIR FUNCTIONS /////

load1.addEventListener(MouseEvent.CLICK,btn4Clicked);
load2.addEventListener(MouseEvent.CLICK,btn4Clicked);
load3.addEventListener(MouseEvent.CLICK,btn4Clicked);

///// END LISTENERS /////


///// START FUNCTIONS /////

function btn4Clicked(e:MouseEvent):void { //-- START btn4Loaded
        if (e.target == load1 || e.target == load2 || e.target == load3) {
            myLoadedSwf.gotoAndPlay("outro");

            removeChild(myLoadedSwf);

            urlRequest = new URLRequest(e.target.name+".swf");
            loader.load(urlRequest);
            addChild(myLoadedSwf);
        }

}

and it works, once clicked, it does what it has to do. Ofcourse, me trying to break it, i found that if i click the buttons fast, it will re-import the external swfs causing me to have multiple instances of the external swf.

so in short, if i click like normal(slow ) ie like a person that clicked to view a section etc, then its fine, if i click fast or repeated clicking ie like a person that double clicks etc, then the problem occurs.

any ideas how to fix this?

thanks in advance.

edit*** heres a link to test file to show what i mean
http://www.somdowprod.net/4testing/flash/tst

  • 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-25T14:36:50+00:00Added an answer on May 25, 2026 at 2:36 pm

    When you set doubleClick to enabled on your movieclip, this will work. The Flash runtime will thencheck for you if it is a double click and only trigger your method once. If you want to listen for the double clicks, you can by changing the event handler.

    mySprite.doubleClickEnabled = true;
    mySprite.addEventHandler(MouseEvent.CLICK, onClick);
    

    Good luck.

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

Sidebar

Related Questions

This is my code for the Main class: package { import flash.display.*; import flash.events.Event;
I kind of wrote this piece of code: import csv import os fileobj =
For get device id in android sdk i wrote simple This code :: import
I wrote this code. import socket host = 'localhost' port = 3794 s =
I'm using this code to create a custom Event class: package evt { import
I wrote this code I have these errors Cannot implicitly convert type x.Program.TreeNode' to
I wrote this code in C# to encrypt a string with a key: private
I wrote this code. The constructor works normally, but in the destructor I get
If I wrote this code: typeof(myType).TypeHandle Would it use reflection? How much different from:
Hi guys I wrote this code and i have two errors. Invalid rank specifier:

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.