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:
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 :
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