Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-09-2006, 12:43 AM   #1
john100
Registered User
 
Join Date: Feb 2006
Posts: 22
Default Creating VBox in ActionScript or Code

I have this simple xmxl code. I would like to create exactly the same things in Action Script

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" layout="absolute">
<mx:Canvas x="82" y="66" width="1000" height="1000">
<mx:VBox x="163" y="114" width="100" height="100" cornerRadius="5" borderThickness="5" borderStyle="solid" backgroundColor="#8facff">
<mx:Image click="getURL('http://www.cnn.com')" source="0004734.jpg" width="29" height="24" verticalAlign="bottom" />
<mx:Image click="getURL('http://www.cnn.com')" source="0004734.jpg" width="29" height="24" verticalAlign="bottom" />
</mx:VBox>
<mx:VBox x="19" y="13" width="100" height="100" cornerRadius="5" borderThickness="5" borderStyle="solid" backgroundColor="#8facff"/>
</mx:Canvas>
</mx:Application>


thank you in advance
john100 is offline   Reply With Quote
Old 02-09-2006, 05:18 PM   #2
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

in as3 you would

ActionScript Code:
import mx.controls.Button;             import mx.containers.VBox;             private function someFunction():void             {                 var n:VBox =   new VBox();                 var p:Button = new Button();                 var z:Button = new Button();                 n.addChild(p);                 n.addChild(z);                 p.label = "hallo";                 z.label = "hallo 2";                 this.addChild(n);             }

in flex 1.5 as2 you need to use createChildren, thats pretty simmiliar to this approach
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 02-11-2006, 04:57 AM   #3
john100
Registered User
 
Join Date: Feb 2006
Posts: 22
Default

Thanks it works
john100 is offline   Reply With Quote
Old 02-12-2006, 11:07 AM   #4
Incrue
the ever-living
 
Incrue's Avatar
 
Join Date: Jan 2006
Location: inside this plane
Posts: 113
Send a message via MSN to Incrue
Default

Wait...xmxl? This thing wasnt called xml?Or it is another thing?
And this addChild...this seems to put an object inside another, isnt it?OR it is to put a xml child inside another?
This is so confusing...
Incrue is offline   Reply With Quote
Old 02-12-2006, 03:40 PM   #5
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

it is called mxml. yes addChild adds a child to the displayList. this has nothing todo with xml
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion from swf file to actionscript code TechnoPhobic ActionScript 1.0 (and below) 5 08-10-2005 10:27 AM
Code for creating ComboBox Danneman Components 2 07-26-2005 02:10 PM
Creating better code..How? Brisa ActionScript 2.0 7 10-18-2004 09:14 PM
Can't find ActionScript code on downloaded .fla file schoollibrary Simple Stuff (Newbies) 2 03-19-2003 05:54 AM
revised Actionscript Dictionary online robertpenner ActionScript 1.0 (and below) 3 07-22-2001 08:57 AM


All times are GMT. The time now is 09:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.