Flasher Archive

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


Subject: Re: FLASH: Collecting Info from Flash Movie (2)
From: Nigel Randsley-Pena
Date: Tue, 29 Jun 1999 11:17:20 +0100

Jeff,

"This route was based on info in a MACR technote (# 04160)..."
I had suspected it was. Macromedia is well know for good software and
shoddy manuals. Technote 4160 was last updated Feb 1999 but still refers
to Flash 2 and with Flash 2 that was the only route. From Flash 3
onwards use FSCommand.

> The way I have used it so far is: at the first question the player
> answers a clicking on button 'A' or button 'B'. These buttons have the
> following actions attached to them:
>
> On(Release)
> Go to and stop <----- [Label - A] or [Label - B]
> GetURL <----( [FSCommand:button1] in URL box
> End On ( [1a] or [1b] in target box

You can do the following :
On(Release)
Go to and Stop <----[Label -A] | [Label B-] (no change here)
FSCommand <----Command : Click
<----Args : 1, A or B
End On
The Command can be the same you only need one function to parse the
results.
The args will reflect the question number 1 to 6 plus the cheat and the
answer state A or B. So you could have as args 1,B for question 1 answer
B.
Now your javascript to handle this would be something like this:
(I always name my movies theMovie)
function theMovie_DoFSCommand(command, args) {
var argv = String(args).split(",");
var argc = argv.length;
.....

}
This way you can use the command var to detect which command is being
called, argc gives you the number of arguments sent and argv is an array
with the arguments so argv[0] would contain 1 and argv[1] would contain
B using the above example.
In your case argc is not really needed but I left it there because it
nice to have. I sometimes use FSCommands with a variable number of
arguments and this way I can handle them.

> I am assuming that this would then send the message "1a" or "1b" to an
> array called "button1" in the javascript. This method would then be
> repeated for the remaining questions (button2, 3, 4, etc). At the end
> of the game, this information needs to be passed back to Flash to
> customise the end screen, so that it could say: You answered 'A' to
> Q1, 'B' to Q2, etc. and provide a customised profile. When the player
> clicks a 'mailto:' button on this end screen, the information would
> then be included with their email (I am beginning to think this last
> bit may be better as a form which could be submitted ?).

Yes in fact your best option is to store all the answer pairs in an
array.
If you number the buttons then you can use the value as an index into
the array and it only needs to store the answer given, either A or B.
At the end of the game this array is used to trigger the final screen.
You can have six mc's with a starting blank park frame then do a series
of tt on each of them via javascript using the values of the array to
target the proper frame in each mc.
If each mc is mc1 trough mc6 the you could do something like this in a
Javascript function
....
TGotoLabel(/mc1,button[0]);
TGotoLabel(/mc2,button[1]);
etc...
This array will also be used as input into your email, but a form would
be much better and you can populate it's fields with the array's values.
With Flash 4 this could be done with a final form that the user can
submit with Flash 3 you can place the form in a hidden frame.

Hope this helps

Nigel

------------------------------------------------------------------------
To UNSUBSCRIBE send: unsubscribe flasher in the body of an
email to list-manageratshocker [dot] com. Problems to: owneratshocker [dot] com
N.B. Email address must be the same as the one you used to subscribe.
For info on digest mode send: info flasher to list-manageratshocker [dot] com


Replies
  Re: FLASH: Collecting Info from Flash Mo, Jeff Talbot

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