# Trouble with MovieClips in classes

**URL:** <https://forum.kirupa.com/t/trouble-with-movieclips-in-classes/285726>\
**Category:** Uncategorized\
**Created:** [April 5, 2009, 12:04am UTC](https://forum.kirupa.com/t/trouble-with-movieclips-in-classes/285726 "2009-04-05T00:04:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![artheus](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@artheus](https://forum.kirupa.com/u/artheus)\
**Post date:** [April 5, 2009, 12:04am UTC](https://forum.kirupa.com/t/trouble-with-movieclips-in-classes/285726/1 "2009-04-05T00:04:11Z")

</div>

Hi!  
I am a newb at classes. And now I’m trying to make a Iphone just for fun. And I’ve come to the point where I want to add the buttons (the Icons on the display which act like buttons).

So I’ve made a new Libraryobject, a MovieClip, which I’ve put in different icons on different frames. And named the frames, the name of the icon.

the class of the movieclip where I add the buttons:

```auto

package src
{
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.MouseEvent;

    public class iphone_content extends Sprite
    {
        public var buttons:Array = []; //the array where I will add the different buttons
        public var faces:Array = ["app_store", "calculator", "calender", "camera", "clock", "ipod", "itunes", "mail", "maps", "notes", "phone", "photos", "safari", "settings", "sms", "stocks", "weather", "youtube"]; //the different faces of the button

        public function iphone_content() 
        {
            for (var i = 0; i < faces.length; i++) //make a button for each face
            {
                buttons* = new iphone_button(faces*); //add a new button to the array
                
                this.addChild(buttons*); //add the button to the stage
                buttons*.width = 47; //try to change width (fails)
                buttons*.height = 47; //try to change height (fails)
            }
        }
    }
}

```

class iphone\_button :

```auto

package src
{
    import flash.display.MovieClip;

    public class iphone_button extends MovieClip
    {
        
        public function iphone_button(face:String):void 
        {
            gotoAndStop(face);
        }
        
    }
    
}

```

Well what happens is that when it has gone through this code, it puts out all of these movieclips. But… It just won’t change the height/width of the objects. Or at least not the way I want it to do. I want the height&width of the objects to be 47 pixels each.  
What should I do to make this work?

Cheers,  
Artheus
