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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:30:03+00:00 2026-05-22T17:30:03+00:00

I have an an class a fla called draw.fla . The document class associated

  • 0

I have an an class a fla called draw.fla . The document class associated with draw is Draw.as The code inside Draw.as is as follows

package
{
import flash.display.MovieClip;
import flash.display.Graphics;

public class Draw extends MovieClip
{
    public  function drawCircle1(color:Number):void
    {
        graphics.beginFill(color);
        graphics.drawCircle(100,100,40);
        graphics.endFill();
    }

}
}

The resulting swf is called draw.swf.

I have another fla called test.fla.

The following is the code on the first frame on the main time line.

import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.display.Loader;

var swfLoader = new Loader();
var color:Number;

color = Math.round(Math.random()*0xFFFFFF);
var urlReq:URLRequest = new URLRequest("draw.swf");
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoadComplete);
swfLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, swfLoadError);
swfLoader.load(urlReq);

function swfLoadComplete(evt:Event):void
{
    var loader:Loader = Loader(evt.target.loader);
    addChild(loader.content);
    swfLoader.removeEventListener(Event.COMPLETE, swfLoadComplete);
}

function swfLoadError(evt:IOErrorEvent):void
{
  trace("Unable to load swf ");
  swfLoader.removeEventListener(IOErrorEvent.IO_ERROR, swfLoadError);
}

I have loaded dwaw.swf into test.swf as you can see. Is there anyway I can access the drawCircle1 function of Draw from the test.fla. Actually I need to pass the value color as an argument while accessing this function.

  • 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-22T17:30:04+00:00Added an answer on May 22, 2026 at 5:30 pm

    If I’m not wrong, once the loader is complete you could simply make MovieClip(loader.content).drawCircle1(0xFF0000);.

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

Sidebar

Related Questions

I've the following code in my displayandmove.as file: package { import flash.display.MovieClip; public class
I have this base class package sevengames.miranda.front.res { import flash.display.MovieClip; import flash.text.TextField; public class
I have a MovieClip symbol created with flash in a fla file library. There
I have an .fla that links to a generic Document class which manages the
If I have a Document class that extends MovieClip, and I want to use
I have an SWC with a class called Content. I want to set it
the document class of my .fla file has a lot of references to elements
Is it possible to use a Document class that is above the FLA in
I'm working with an fla, an as file(document class), and a jsfl file. the
I've created a small component in Flash CS4, and I have associated my MyComp

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.