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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:12:32+00:00 2026-06-11T23:12:32+00:00

Ok Ive got a simple flash file, since im trying to accomplish accessing a

  • 0

Ok Ive got a simple flash file, since im trying to accomplish accessing a variable from the main stage inside a movie clip. All the things Ive found from google point to MovieClip(root). But its not working for me.

On the main timeline:

var MyName:String;
MyName = "kenny";

Then I have a movieclip called MyBox, its code:

trace(MovieClip(root).MyName);

And I get this error: TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@2d2df089 to flash.display.MovieClip.
at MyBox/sendpmtext()

I have also tried MovieClip(parent), MovieClip(parent.parent), MovieClip(stage), MovieClip(this.stage) and no luck. Any help please?

  • 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-11T23:12:34+00:00Added an answer on June 11, 2026 at 11:12 pm

    You could just do

    parent["MyName"];
    

    OR, a proper casting of the main timeline (in your context, the parent is of type MainTimeline):

    MainTimeline(parent).MyName;
    

    Parent is always a DisplayObjectContainer, which has no special properties you create. If you create custom properties, then you need to cast to the class that has those custom properties before you’ll be able to access them by name. (the compiler otherwise doesn’t know they exist, and gives you that error).

    root refers to the topmost stage of your swf. Your main timeline is actually a child of stage, so vars/objects/methods on the main timeline are not a part of stage


    If your using stage.addChild(MyBox), then stage is the parent, and not the main timeline. If for some reason you need to have stage as the parent, then you’d have to keep a reference to the mainTimeline somewhere you can access. You could create a var to do this in your MyBox timeline.

    var mainTimeline:MainTimeline;
    

    Then in the main timeline code, do this:

    MyBox.mainTimeline = this;
    

    Then you can access your var within MyBox by doing mainTimeline.MyName;

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

Sidebar

Related Questions

I've got a simple web-page that generates a CSV file that I want the
Here's a very simple AS3 project. The stage is not null in the main
I've got the following simple scenario: I parse manifest.json (a JSON file) I add
I'm trying to make a fairly simple image slideshow to replace a flash based
I've got a simple Flash client connecting to a Flash Media Server, and I'd
im trying to build a simple application with express@3.0.0rc4 , and socket.io@0.9.10 . Ive
I've got a simple application that is supposed to rotate a decorated wheel so
I've got a simple js/jquery function I want to run when the form is
I've got a simple function script, the last line of which is to call
I've got a simple C class I have implemented, using function pointers in a

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.