Flasher Archive

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


Subject: RE: FLASH: Getting variables from MCs
From: Paul Willoughby
Date: Mon, 4 Sep 2000 14:26:55 +0100

Hi James,

Finding them damn targets can be a right pain I know, so maybe I can relieve
your misery. There's two different ways to solve your problem. The first
would be to change the code in your movie clips to:

On (Release)
Set Variable: "/:q1" = 1
End On

The /:, means the variable is set on the main timeline, rather than within
the movie clip. The way it's currently set up (i.e.Set Variable: "q1" = 1)
means the variables only exist in their respective clips, which brings me on
to solution 2...

You can target a variable within a movie clip as long as the clips all have
defined instance names. So, write your addition code as:

Set Variable: "score" = /target1:q1 + /target2:q2 + /target3:q3 +
/target4:q4 etc.

I think the first solution is better, but it depends on what you're trying
to do with the code.

hth

Paul


-----Original Message-----
From: James Cutts [jamesatinone [dot] co [dot] uk (mailto:jamesatinone [dot] co [dot] uk)]
Sent: 04 September 2000 13:15
To: flasheratchinwag [dot] com
Subject: FLASH: Getting variables from MCs


Hi all

Can anyone help me with my little action-scripting question:

I have a main time-line ('movie') with 10 MCs strung along it with instances
of QI - Q10.

Each of these MCs allows the user to assign a value to
a variable.

The code within the MCs is:

On (Release)
Set Variable: "q1" = 1
End On

and so on up to "q10".

I then need to add these variables up.
So I have a frame at the end of the movie containing the following code:

Set Variable: "score" = q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10

I then need to display the 'score' to the user so i have an editable text
field (in the last frame of the movie) with a variable of "score" which I
know is set up correctly.

Now the problem: It doesnt work. I think its because I need to specify a
path to the individual MCs to get their values but I dont know the correct
syntax.

Can anyone help?

TIA

J
----------------------------
James Cutts

d e s i g n m a n a g e r
i n o n e n e w m e d i a

Tel: +44 (0)20 7978 6500
jamesatinone [dot] co [dot] uk
http://www.inone.co.uk




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NudeGuru.com is proud to sponsor the Flasher list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IT'S THE ART OF MONEY, HONEY!
Tips and Advice from some of the most popular Flash
artists + industry power-brokers on how to hold onto
your rights, negotiate contracts and get full value
for your work.http://www.nudeguru.com from Franke James
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


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