Click to See Complete Forum and Search --> : Scripting
OwenAus
07-11-2001, 02:19 PM
I am at a bit of a loss with FS, which I assume is action scripting. This is what I am trying to do:
Frame 1:
Set variable: "counter" = 0
Frame 2:
Set variable: "counter" = "counter" + 1
frame 4:
if (:/counter = 3) go to and play (5)
(frame 4 also has a goto frame 2, following the script)
(and what goes where in the command/argument boxes?)
frame 5 - continues.
The objective being to repeat frames 2-4 three times, rather than create 9 frames (3 sets of 3)
What I get is more action than I expected. :) Multiple windows opening, faster than I can close them.
I have tried several ways of entering these using the command and argument boxes. All attempts give the same result. A screenful of windows.
So, how many ways have I got it wrong? And what is the right way? Anyone?
Thanks.
johnie
07-11-2001, 03:12 PM
FS Commands are not actionscripting. A FS command sends a variable and a value Active X or Live Connect. You then need to catch those.
What you are trying to do can be done but not the way you are going about it.
http://www.macromedia.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash.html explains FS Commands and Flash Player Methods.
OwenAus
07-11-2001, 10:48 PM
Thanks for the reference.
I hope I can manage this.
I have a go-go dancer and some music. The dancer has a number of simple steps/sequences. Mixing the sequences gives a reasonable result.
I am trying to get the equivalent of macros or subroutines going, so that the movie would initiate a frame sequence (macro/scene/subroutine?) at a given time, this would iterate a number of times and then hand control back to the main sequence, which calls the next sequence.
Alternative is to use 100s of frames in a straight run, versus a handful the macros.
johnie
07-11-2001, 11:40 PM
It should be manageble since frame labels work right.
OwenAus
07-12-2001, 12:13 AM
Yeah, I believe it technically possible.
I am more concerned about my own abilities.
I am waaaaaay outside my own area of expertise and on an enforced high-speed learning curve in a number of areas, this being one.
Fingers crossed, eyes crossed, recticular activation system engaged and cerebral overload accompanied by excessive synaptic flashes.
:)
Thanks for the help.
OwenAus
07-12-2001, 10:34 PM
Okay, I am still struggling with this.
According to everything I have read at macromedia and elsewhere, I think that the following HTML code should work:
<SCRIPT LANGUAGE="JavaScript">
<!--
function seq_DoFSCommand(command, args)
{
// if ( command == "anAlert" )
// {
alert("Here's the Flash message: " + args);
// }
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
// Handle IE.
Sub seq_FSCommand(ByVal command, ByVal args)
call seq_DoFSCommand(command, args)
end sub
//-->
</SCRIPT>
where my movie name or id is "seq".
The sequence is frames 1 to 9.
Frame 9 goes back to frame 3 and plays.
Frame 2 attempts to get the alert box up. I make the FS command (using FS appears to be acceptable from the references) "anAlert" and the arguement "me"
The sequence for "seq" runs fine, however I get a new window popped up with "page cannot be found" instead of the alert.
The above is an almost direct crib of a download from:
* http://www.moock.org/webdesign/flash/fscommand/index.html
which does work, so I guess I am entering the FS incorrectly, somehow.
Here is another site that suggests the above is acceptable:
* http://www.ashzfall.com/flash/
Using the JS scripting option instead of FS (movie->sounds actions->add action->advanced) does the same thing, attempting to reference a js function within HTML.
Syntax here? Is the "script language=javascript" required in the dialogue box, or just the function name, or what.
Help!
johnie
07-13-2001, 12:24 AM
What are you trying to do? If you are just tring to send somthing to JS then the fs command is not needed. use javascript instead.
Mook and the writers for Macromedia and just about every other "Guru" on this subject has flaked out. FS Commands are only Good on IE 3- on the PC and NS 2-4.7 on the PC and NS 4-4.7 on the MAC. Javascript works on just about every browser except IE 4.0 (People with IE 3.0 are hard to find since 3.0 had a security leak in it that allowed hackers to erase the hard drive from a regular HTML and most people upgraded) and lower and NS 2.0 and lower. The secrete sauce for Javascript is void(0); FSCommands shouldn't return an error- I'll look into it.
read my articles on scripting with koolmoves- http://www.koolmovers.com/search.php?query=scripting+&topic=&category=0&author=&days=0
I'm finishing up part 6 and will have it posted in about a day or two.
Part six deals with FS Commands and Advanced scripting.
OwenAus
07-13-2001, 01:17 AM
Currently all I am trying to do is get communication between a swf and js in html. :)
When that is done I will be able to apply the knowledge to the dance routine movie.
Your tutorials are awesome, BTW, and I echo what Matt said on KoolMovers, about you being one of the most prolifically helpful guys on the web. Thanks.
Is using search the only way to find your stuff on KoolMovers? The tutorial link on the sidebar leads to 4 images. Clicking these leads to pages with nothing listed (except some preliminary text, etc).
johnie
07-13-2001, 01:33 AM
For a while I was doing a story a day at KoolMovers- Those tutorials went into a general articles becuase the sections at Koolmovers were not done yet and if I hadn't written then there wouldn't have been much news going on at Koolmovers.
So in otherwords, yes searching is the only way right now- Matt is tied up with a couple of jobs right now but when he gets done and has more time he is going to work on fixing Koolmovers.
When Digital Dog Gives me the go ahead I'm going to write about his new screensaver product and the Swish 2 launch is comming up. It'll make me feel better about the big let down of Open LGX not installing and facing the possibility that it is vaporware.
OwenAus
07-13-2001, 01:54 AM
Okay, this now works for FS command and for JS:
<SCRIPT LANGUAGE="JavaScript">
<!--
function DoAlert()
{
document.write('got here<br>');
alert("HERE");
}
function seq_DoFSCommand(command, args)
{
alert("FS got through");
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
// Handle IE.
Sub seq_FSCommand(ByVal command, ByVal args)
call seq_DoFSCommand(command, args)
end sub
//-->
</SCRIPT>
</HEAD><BODY BGCOLOR="#FFFFFF">
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
WIDTH="100%"
HEIGHT="100%"
CODEBASE="http://active.macromedia.com/flash3/cabs/"
ID=seq>
<PARAM NAME="MOVIE" VALUE="seq.swf">
<PARAM NAME="PLAY" VALUE="true">
<PARAM NAME="LOOP" VALUE="true">
<PARAM NAME="QUALITY" VALUE="high">
<PARAM NAME="SCALE" VALUE="SHOWALL">
<EMBED
NAME="seq"
SRC="seq.swf"
WIDTH="100%"
HEIGHT="100%"
PLAY="true"
LOOP="true"
QUALITY="high"
SCALE="SHOWALL"
swLiveConnect="true"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/"
</EMBED>
</OBJECT>
In this instance the fsCommand used can be anything, with no args, as the above does not check for anything. :)
Syntax of the JS is:Javascript:DoAlert();void(0); and the void eliminates the new window prob. Thanks.
Reason JS was not handling it before appears to be (this is too silly) case sensitivity (lowercase D in DoAlert in the KoolMoves dialogue box - my bad. *dons dunces cap*)
Thanks again.
Now to see if I can pass info the other way, without stupid mistakes. lol.
Hmmm. I wonder if it is possible to create forms / text fields in KoolMoves.
OwenAus
07-13-2001, 02:17 AM
PS:
KoolMoves is a good product - what will give it real push is perceived user support ("100 monkey club" syndrome, or critical mass) AND good documentation.
So your tutorials, and all the guys that have put the various sites up, etc, are to be applauded.
Also, when enough stuff is up, someone will write a detailed help section for the product itself.
johnie
07-13-2001, 02:29 AM
Originally posted by OwenAus
Hmmm. I wonder if it is possible to create forms / text fields in KoolMoves.
Not Yet. Editiable text fields need to be supported first. They would be pretty useless without actionscripts except Swift Generator and Form 2 Flash could be used if we had them.
I've been saving all everything I write about KoolMoves and will probably hand it over to Bob or Matt to make a book out of.
OwenAus
07-13-2001, 11:01 AM
That is a good idea. (The book - hopefully also a fully-fledged online tutorial or downloadable tutorial).
:)
The thing I am currently working on is a "concept" movie, to be burnt onto CDs with an autorun facility and sent to some clients, as a presell for another project.
The bit that I am fiddling with at the moment is a dance routine. I have uploaded it to:
http://www.gemcutters.net/gems/noshow/dancer.html
I pulled out the private stuff, cut it down to about 2/3rds size and dropped some dance moves, pulled the client specific stuff out and replaced some of that with some KoolMoves promos. :)
It is not really suitable for the internet, and the chopped up bit you see is clunky, out of sync, and still big
- but it shows the reason I am trying to control repetitions. Three dance moves (hip-slap, hip-swivel and foot-tap) are included in this bit.
When I get a bit experienced with this, things like this will become smaller (I hope) and web-swf'able.
(If you do check it out, ignore the gemcutters stuff. That goes nowhere, it is preliminary stuff for a new site and probably will be very different when done.)
johnie
07-13-2001, 01:18 PM
Looks realy good to me.
I can see what you are trying to do.
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.