Flasher Archive

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


Subject: FLASH: need actionscript help: variable not registering in if conditional(?)
From: a p r i l b i n g h a m
Date: Mon, 17 Jul 2000 14:59:06 +0100

i'm having a problem with (seemingly) not being able to read variables in my
actionscript. here's the situation:

i'm trying to do a game where you drag different arms and legs onto a
character who is supposed to have certiain characteristics, and, depending
on whether the arm or leg is the correct one (according to the
characteristic associated with that arm or leg), it will stay in place, or
it will rubberband back to its original location.

i have a movie clip placed on the main timeline called artistic_movie (all
the action happens inside here). all my variables are read in from an
external file at the main timeline of artistic_movie. inside this movie,
there are 12 movie clips, 3 instances each of 4 separate movie clips (2
arms, 2 legs). each of these movie clips consists of a button that is the
hand or arm. the following actionscript is associated with each of the
hand/arm button instances (the variables and _x/_y values change, obviously,
but otherwise, i use this script in all the instances).

************************************
On (Press)
If ((_x = 100) and (_y=225))
Stop Drag
Else
Start Drag ("../drag_left_hand1", L=0, T=0, R=500, B=500,
lockcenter)
End If
End On
On (Release)
If ((((_x >= 80) and (_x < 120)) and ((_y >= 205) and (_y < 245))) and
(../:drag_left_hand1_score = 1))
Stop Drag
Set Property ("../drag_left_hand1", X Position) = "100"
Set Property ("../drag_left_hand1", Y Position) = "225"
Set Property ("../drag_left_hand1", X Scale) = "100"
Set Property ("../drag_left_hand1", Y Scale) = "100"
Else
Set Property ("../drag_left_hand1", X Position) = "400"
Set Property ("../drag_left_hand1", Y Position) = "20"
Stop Drag
End If
End On
************************************

my problem is that the "score" variable in the if conditional of on(release)
doesn't seem to register. that is, i can't ever get the movie to recognize
that the arm/leg is correct, so it always rubberbands back to the original
location. i've tried to run trace to see if i'm actually referencing the
variable correctly from this location, and it shows the correct value.
however, i just can't do it in the actual conditional.

i'm new to actionscript, so maybe someone will see something i don't. am i
doing something wrong? referencing something incorrectly? using the if()
conditional incorrectly. any help is greatly appreciated! my (very
unfinished) working file can be found at

http://www.pulsefx.com/april/game.zip

if you need to see the work-in-progress.

thanks in advance!

april :)
--

a p r i l b i n g h a m
. . . . . . . . . . . . . . . . .

aprilatpulsefx [dot] com
920.436.4777x261




flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 30 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: need actionscript help: varia, Marcelo Siqueira

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