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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:59:09+00:00 2026-05-27T04:59:09+00:00

In ActionScript 3, there are some classes that will represent a value rather than

  • 0

In ActionScript 3, there are some classes that will represent a value rather than the class itself. It’s hard to explain properly what I mean, so take this example:

var str:String = "something";
var mc:MovieClip = new MovieClip();

trace(str); // something
trace(mc); // [object MovieClip]

You’ll notice that the first trace outputs a value, rather than [object String]. Ontop of this, I can still make use of methods of String, like this:

var ar:Array = str.split('s');

Even though in a way you could almost read the above as:

"something".split('s');

I have a class AvLevelData that has some methods that deal with level data (which is essentially a String). At the moment there is a property data:String which represents the core level data.

The question I have is – can I replicate the behaviour of String in that when I trace or assign an instance of AvLevelData, the result is actually the String data.

For example, at the moment I need to go:

var levelData:AvLevelData = new AvLevelData();
trace(levelData.data);

To get the data. I instead want to be able to simply do the following:

var levelData:AvLevelData = new AvLevelData();
trace(levelData); // some level data string

Is this possible?

  • 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-27T04:59:09+00:00Added an answer on May 27, 2026 at 4:59 am

    If you wan’t your object to trace out your own fabricated string then you must implement a toString() function on your AvLevelData class.

    In your example above, the MovieClip trace outputs: [Object MovieClip]; this comes from the default toString() implementation for Object (found on Object.prototype) . Note, you cannot override toString() as it only exists on the prototype of Object (remnants of the AS2/Javascript world), all you need to do is provide your own implementation with the same name. For instance:

    public function toString():String {
       return "MyCustomObjectString";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any actionscript 3 class for fireworks that looks like real and not
Most JavaScript code is also syntactically valid ActionScript 3.0 code. However, there are some
Is there any open source collection framework, written in ActionScript that would emulate HashMap,
i seem to be having some problems with the Vector class in actionscript 3
This is my first time using recursion in actionscript so I'm sure that there
I have a dynamic ActionScript Class that is used to send parameters to a
Is there some sort of interactive ActionScript interpreter? Similar to Firebug's JavaScript command line
Is there AS3 classes/libaries for Flash that, in the traditional meaning of 'Sprite', render
I have some ActionScript code that splits a string using Regular Expression and lets
I'm doing some Actionscript work right now and I'd like to know whether there's

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.