Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
_LJ #1
A very newby question
Hi all,
I am a new learner of Flex and action script. I just got a very simple
question that, for example, if i have 3 HBox:
<mx:HBox id="1" .../>
<mx:HBox id="2" .../>
<mx:HBox id="3" .../>
Then in my action class, for example, if i use:
var text:Text = new Text();
....
this.1.addChild(text);
this.2.addChild(text);
this.3.addChild(text);
Then my template wont generate, i guess there is an error or something. So if
i want to create one component and registered it in 3 or more different
containers, can i do this?
If can't, then how i can just create one component and use it in multiple
place instead of creating multiple components and change them one after another?
Thanks in advance!
_LJ Guest
-
Newby Question: hither and yon?
Hi, I'm new to Shockwave 3D and am trying to work out how to set the hither and yon parameters for my 3D world. At the moment the 3D world is not... -
newby question: error log
hi, how do you define variables (or constants) correctly? my error log ist full with entries like those: PHP Notice: Undefined variable:... -
Newby Question: Displaying Excel from within my CGI
"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message news:bjgepo$iovdq$1@ID-184292.news.uni-berlin.de... Well, he is posting this in a Perl... -
Newby question: Good PHP/Web editor
I have been developping in php for some months. My Web editor is FrontPage. No need to say that editing PHP is far from easy, then. I have tried one... -
Another Newby partitioning question
The primary drive is an old 2GB, slave drive is 10GB. I know I have to install the OS on the primary drive. But is there a way I can load most of... -
007none #2
Re: A very newby question
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="mytest();"<mx:Script>>
<![CDATA[
import mx.controls.Text;
public var text:Text;
public function mytest():void
{
text = new Text();
text.height=40;
text.width = 50;
text.setStyle("borderColor","Yellow");
text.setStyle("borderStyle","solid");
text.setStyle("borderThickness","2");
text.text="hello";
h1.addChild(text);
//h2.addChild(text);
//h3.addChild(text);
}
]]>
</mx:Script>
<mx:HBox x="0" width="100%" height="50" backgroundColor="red" id="h1"
y="100"/>
<mx:HBox x="0" width="100%" height="50" backgroundColor="#0000ff" id="h2"
y="200"/>
<mx:HBox x="0" width="100%" height="50" backgroundColor="#808040" id="h3"
y="300"/>
</mx:Application>
007none Guest
-
theNOCer #3
Re: A very newby question
you could always may and array of them and do it in afor loop
var texts:array = new array();
for( var i:int =0; i < quantity_wanted; i++){
var tmp:Text = new Text()
tmp.width = 50;
tmp.setStyle("borderColor","Yellow");
tmp.setStyle("borderStyle","solid");
tmp.setStyle("borderThickness","2");
....
texts.push(tmp);
}
that will generate as many as you want
as for making one and using it over and over again. im not sure you can do
this. even if you could im not sure you would want it because i would think
when you put text into one the text would appear in all.
theNOCer Guest
-
ntsiii #4
Re: A very newby question
Yes, a single instance of a component can only have one parent.
You are trying to put "text" into three components. Create a new instance for each component.
Tracy
ntsiii Guest



Reply With Quote

