A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [Resolved] [Resolved] adding to an Object?

  1. #1
    Member
    Join Date
    May 2002
    Posts
    54
    my Object(player,place,play);

    I have this Object and I have three buttons. I am setting it up so that the first button is the player, the second button is the place and the third button is the play. this player will be clicked and that will instantiate a new object. One player can have multiple places and plays, but each time a new player is clicked it will make a new object. My question is, is possible to add the content of the buttons to the object. So at minimum the object will always have a player,place,and play. I just don't know if it is possible to add elements to the object from different things?

  2. #2
    I don't quite understand you, but you should try using Classes:

    MyClass= function()
    {
    this.player = "default player";
    this.place = "default place";
    this.play = "default play";
    }

    Then if you create
    objectA = new Myclass();
    objectA.player = "new player";

    Your objectA will have player = "new player" ; place = "default place" ; play = "default play"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center