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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:03:14+00:00 2026-05-24T10:03:14+00:00

hoping this is an easy enough question :) Some details: I am using Flash

  • 0

hoping this is an easy enough question 🙂

Some details:
I am using Flash CS5, never touched Flex. Also the SWF that is doing the loading will be a client SWF, so hoping for a solution that could work with a simple couple of lines.

Basically inside the SWF I am working on contains just a simple string:

var theString = "theString";
trace("theString = "+theString);

Now I’ve been working on a test loader SWF that will load my String SWF and get the variable in the simplest way. Any thoughts? Below is my current broken code:

function loaderComplete(event:Event)
    {
        trace("... in loaderComplete");

        getString = loader.content.toString();

        trace("loader.content = "+loader.content);
        trace("... getString    = "+getString);
    }

This is my output window:

theString = theString
... in loaderComplete
loader.content = [object MainTimeline]
... getString  = [object MainTimeline]

I’ve searched on Stack and found similar questions, but none are exactly what I need:

tracking video files – embedding flv to swf

^ Basically what I’m trying to do as well, no answers yet

to pass variable from one swf to another swf in as3

^ sounded just like my problem, but answer was a Flex application example

pass var values from one swf to another swf who is loaded inside the firts one in AS3

^ This was close, but am not sure how to implement the chosen answer, also seems a bit more intricate then I need

Please help!

  • 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-24T10:03:17+00:00Added an answer on May 24, 2026 at 10:03 am

    Let’s clarify a bit:
    1. The loader swf, we will call the parent.
    2. The swf loaded by the parent we will call the child.

    The Child contains a string, and you want the parent to be able to read that string>
    So…
    The Child must define a public variable for the string. (This means you have to use a Class file for it, since you cannot declare a property public on the timeline.)

    Finally, the parent will try and get that property. You may want to wrap that in a try/catch to handle cases where the string will not be present.

    Here is an example Child Class.

    package  
    {
    import flash.display.Sprite;
    
    /**
     * ...
     * @author Zach Foley
     */
    public class Child extends Sprite 
    {
        public var value:String = "This is the child Value";
        public function Child() 
        {
            trace("Child Loaded");
        }
    
    }
    

    }

    And here is the parent loader class:

     package  
    {
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.net.URLRequest;
    
    /**
     * ...
     * @author Zach Foley
     */
    public class Parent extends Sprite 
    {
        private var loader:Loader;
    
        public function Parent() 
        {
            trace("PArent Init");
            loader = new Loader();
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
            loader.load(new URLRequest("child.swf"));
        }
    
        private function onLoaded(e:Event):void 
        {
            trace("Child Loaded");
            trace(loader.content['value']);
        }
    
    }
    

    }

    The Output will be:
    PArent Init
    Child Loaded
    Child Loaded
    This is the child Value

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

Sidebar

Related Questions

I know this is a vague open ended question. I'm hoping to get some
Im hoping this would be a really easy question for someone.... Basically we are
As a follow-up to this question I am hoping someone can help with the
Hoping to get some clear advice on this one. I want to push updates
I'm hoping this will be relatively easy to someone who is familiar with the
Hoping this is fairly simple. Basically, I'm drawing some text onto an NSView and
I'm wondering about MP3 decoding/encoding, and I was hoping to pull this off in
thanks for all the help the last few days. I'm hoping someone knows this
Hoping someone can provide an answer with this, although it's not 100% programming related.
I have this problem I'm hoping someone knows the answer to. I have an

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.