Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | RE: FLASH: Scaling with ACTIONscript |
From: | Calin |
Date: | Tue, 30 May 2000 09:42:56 +0100 |
>>-----Original Message-----
>>From: Imagelnkaol [dot] com [Imagelnkaol [dot] com (mailto:Imagelnkaol [dot] com)]
>>Hi all, i want to make a menu system where i click one
>>button, and it makes
>>the menu full size, and if i click that button again, it
>>shrinks back down.
>>
>>In the main timeline on the first frame i have
>>
>>Set Variable: "size" = "2"
>>
>>
>>and in the actions for the button that i am using to
>>explode/shrink the
>>menu, i have
>>
>>On (Press)
>> If (size = 1)
>> Set Property ("/Menu", X Scale) = "10"
>> Set Property ("/Menu", Y Scale) = "10"
>> Set Variable: "size" = "2"
>> End If
>> If (size = 2)
>> Set Property ("/Menu", Y Scale) = "90"
>> Set Property ("/Menu", X Scale) = "90"
>> Set Variable: "size" = "1"
>> End If
>>End On
>>
>>
>>But when i test this, when i click it the first time, it
>>"exlpodes to full
>>size" as it should, but when i click the button again, it
>>doesnt shrink down.
>>Does anyone k now whats causing that to happen?
>>
>>TIA
Hi.
Here's what you have to do to make it work:
1. In the main timeline on the first frame:
Set Variable: "size" = 2, not "size" = "2".
2. In the button action:
On (Press)
If (size = 1)
Set Property ("/Menu", X Scale) = 10
Set Property ("/Menu", Y Scale) = 10
Set Variable: "size" = 2
End If
Else
Set Property ("/Menu", Y Scale) = 90
Set Property ("/Menu", X Scale) = 90
Set Variable: "size" = 1
End If
End On
You don't need the second If, you should use "Else" since size is either 1
or 2. If is correct too, but unnecessary. Strangely enough, when you assign
a value to a variable, you should use the variable name set to "String
literal", but when you compare it to a number value, you should use the
following syntax: If (size = 2). No quotes around size and around the scale
values. It would be good for Flash to make a difference between string
variables and number variables, like Javascript does (and many other
programming languages), but for the time being it seems we'll have to do
with that.
HTH,
Calin
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
World Animation Celebration - Big Internet Animation Pow Wow Discount Offer
Register before May 25 mention flasher and save 25%!! www.wacfest.com
Be discovered, get a job or have your web series picked up. A big talent search for Shockwave
and Flash animators is happening May 30-June 4 in Hollywood. Featuring Rob Burgess, Matt
Groening, Brad Bird and more. www.wacfest.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]