[Arp] Re: Using ArpForms
Nils Millahn
nils.millahn at deltabravo.com
Wed Feb 16 02:19:12 PST 2005
Hi Bruce,
has this been resolved now? Your Actionscript code looks fine, except
for your declaration of the actionButton property - you are typing it as
'Button'. If I'm not mistaken, you should be using mx.controls.Button
here - Button on its own refers to the Button object that was around in
Flash 5 and MX.
private var actionButton:Button;
becomes
private var actionButton:mx.controls.Button;
(even though you import mx.controls.*, you still need to be explicit
here when dealing with Button)
With your code you should be getting a compile-error when you try to
addEventListener to the button - is that the case? [There is no method
with the name 'addEventListener']
- Nils.
Bruce Raggett wrote:
> Hello Omar,
>
> Thank you for your reply.
>
> I am still not able to connect components within the .fla to vars
> within my class.
>
> After reading your email message, I first attempted to set up a movie
> clip in the library using the following class which extends
> com.ariaware.arp.ArpForm:
>
> import com.ariaware.arp.ArpForm;
> import mx.controls.*;
>
> class com.phicorp.calculator2.Application extends com.ariaware.arp.ArpForm
> {
>
> private var inputText:TextInput;
> private var outputText:TextInput;
> private var actionButton:Button;
>
> function Application ()
> {
> stop();
> }
>
> function onLoad ():Void
> {
> actionButton.addEventListener("click", this);
> }
>
> function click ():Void
> {
> outputText.text = inputText.text;
> }
>
> }
>
> My expectation was that if I could get the above class to run and I
> clicked the button after entering text into the TextInput field called
> inputText, then this text would appear in the TextInput field called
> outputText.
>
> I successfully set up the movie clip in the library using the
> instructions in the ARP Developer's Manual under the heading "Using
> ARPForms". However one of the instructions there "Drag an instance of
> the Application symbol on stage", which I interpreted to mean drag the
> symbol from the library to the stage, resulted in the following error
> message: "You cannot place a symbol inside itself".
>
> I then dragged three components from the Components frame onto the
> stage, two TextInput components and one Button component, and in the
> Properties frame changed the instance names of the three components to
> inputText, outputText, and actionButton.
>
> I then tested my application using Control > Test Movie, but clicking
> the button did not display the inputText text in the field called
> outputText.
>
> When I was placing the components onto the stage, I noticed that I was
> placing the components onto the Document as opposed to a Movie Clip,
> and thinking this might be significant, I repeated the test as follows:
>
> I used File > Import > Import to Library to import a .gif image into
> the library.
>
> I then dragged the image from the library onto the stage and resized
> it on the stage.
>
> I then clicked on the image in the stage, selected Convert to Symbol
> in the pop-up menu, and then associated the movie clip that it created
> in the library with the class documented above.
>
> I then dragged three components from the Components frame onto the
> movie clip on the stage, two TextInput components and one Button
> component, and in the Properties frame changed the instance names of
> the three components to inputText, outputText, and actionButton.
>
> I then tested this application using Control > Test Movie, but again
> clicking the button did not display any inputText text in the field
> called outputText.
>
> Can you see what I am doing wrong, and also answer the following
> questions for me?
> (1) Does my class above appear to be correct ie should clicking the
> button display the inputText text in the outputText field?
> (2) Does it matter whether the components are dropped onto the
> Document or onto the movie clip on the stage?
> (3) When I received the error message "You cannot place a symbol
> inside itself", what should I have done to make the movie clip appear
> on the stage (I clicked on various parts of the stage but the Property
> frame always displayed Document)?
> (4) When I added the components to the stage, I changed their instance
> names to the var names in my class. Is this how the connection is made?
> (5) The var names existed in my class before I added the components to
> the stage. Is this ok, or do I need to add the components to the stage
> before defining the vars in my class?
>
> I'm probably doing something dumb, but hopefully you can get me back
> on the right track.
>
> Many thanks,
> Bruce.
>
>
>------------------------------------------------------------------------
>
>No virus found in this outgoing message.
>Checked by AVG Anti-Virus.
>Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Arp mailing list
>Arp at ariaware.com
>http://ariaware.com/mailman/listinfo/arp_ariaware.com
>
>
More information about the Arp
mailing list