Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: Radio Buttons setting a variable
From: Pete Grant
Date: Thu, 20 Jan 2000 05:22:28 GMT

Today, my greatest accomplishment was being able to give Dry Cat Food to a
wet cat.

Tomorrow might not even be as good if I can't get the my radio buttons to
set a variable.

I'm using the basic radio button setup in Libraries->Radiobutton. I've been
reading the tutorial on
http://www.macromedia.com/support/flash/interactivity/widgets/ and still
not getting the whole picture.

I have two instances of RadioButtonContainer ("top" and "bottom") and 3
buttons in each. I want to find out which button has been pressed and put
the number (1,2, or 3--which are also the instance names of the MCs imbedded
in the RadioButtonContainer) into vars "top" and "bottom" so I can do
arithmetic with them, then drive a fairly elaborate MC.

The radio button script is basic and covered pretty much line-by-line in the
above-referenced URL:
On (Press)
Set Variable: "numChildren" = ..:numChildren
Set Variable: "counter" = 1
Loop While (counter <= numChildren)
Set Variable: "arrayElement" = "..:child_" & counter
Set Variable: "control" = Eval (arrayElement)
Begin Tell Target (control)
Go to and Stop (1)
End Tell Target
Set Variable: "counter" = counter + 1
End Loop
Set Variable: "..:selected" = _target
Go to and Stop (2)

Comment: here's what I added

Set Variable: "/:pressed" = _target
Call ("/:Decisions")
End On

The first thing "Decisions" does is call "Pressed to top or bottom" which
starts like this:

If (/top:pressed="/top/1")
Trace ("top 1")
Set Variable: "/:top" = 1
Else If (/top:pressed="/top/2")
Trace ("top 2")
Set Variable: "/:top" = 2

...and so on

End If


The variable "pressed" gets sent OK and is in the above format, like
"/top/3". But, in "Pressed to top or bottom", whatever gets evaluated first
gets evaluated as true. (I can drag /bottom/3 up to the top and it will set
bottom=3--always.)

Any help would be vastly beneficial to my sanity and that of those around
me, if there are any around me. I haven't looked lately.

Best regards,

Pete Grant
www.petegrant.com



flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Streaming Media WEST '99 Conference & Exhibition
"The Worlds largest Internet Audio & Video Event"
December 7 - 9, San Jose Convention Center, California

Reserve your space today at http://www.streamingmedia.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: A couple Newbie Questions, Marc Hoffman, Poison Dart

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]