Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-11-2004, 02:59 AM
Junior Member
 
Join Date: Jun 2004
Posts: 8
Default variables FFish<->AS question

I have a question, didn't find anything about that in forums and help :/

I've found an example of how Setvariable (servar.zip) is working here in forums, but in this example it shows how to set text in the text field component. It doesn't show how to define AS variable from FFishScript . To be short the problem is that.. I have an SWF file and for example I want to define _root.somevar in it BEFORE swf file starts, not after pressing the button etc.. but before it starts.. nothing works for me.

I've tried many things, was calling FFishScript function from AS using fscommand at the beginning of AS script, was trying to bind vars.. nothing works. When movie loads _root.somevar is undefined , looks like FFishScript functions run after SWF loads. Is this true? if so what is the solution? how can I set variable in SWF movie from the very start taking it from FFishScript?
Reply With Quote
  #2 (permalink)  
Old 06-13-2004, 05:01 AM
Member
 
Join Date: Jan 2003
Posts: 56
Default Re:variables FFish<->AS question

I'm not a SWFKit expert, so I'd suggest the admin helping here if I'm incorrect, but try something like this in the Initialize script of your SWFkit projector:



FlashPlayer.setVariable("_root.somevar",somevar_fr om_swfkit);

This way this variable will be set in the Flash movie when the projector runs. As a safety thingy, leave like 3 frames blank at the start of the movie, I've noticed that when working in Flash with loadvarnum and ActionScript like that, it will take about 3-4 or so frames before the variables are loaded.
Reply With Quote
  #3 (permalink)  
Old 06-14-2004, 03:19 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:variables FFish<->AS question

You cannot define an AS variable in FS. You can only set the values of variables in AS by calling the FlashPlayer.setVariable method in FS. The AS and The FS are two different worlds connected by fscommands(in AS) and the FlashPlayer object(in AS).

All FFish scripts will be called in AS using fscommand except the "Initialize" script. The "Initialize" script is called automatically just after the main window is created, before the main movie is loaded. You cannot set the variables of the main movie in "Initialize" script for the main movie hasn't been loaded while calling the "Initialize" script.
Reply With Quote
  #4 (permalink)  
Old 06-14-2004, 06:34 AM
RJS RJS is offline
Member
 
Join Date: Sep 2003
Posts: 56
Default Re:variables FFish<->AS question

How about writing the required variable as a name&value pair to a file in the SpecialFolders.appath during the Initialize script.

Then get the Flash movie to access the variables with the LoadVars class

Rob
Reply With Quote
  #5 (permalink)  
Old 06-17-2004, 06:58 PM
Junior Member
 
Join Date: Jun 2004
Posts: 8
Default Re:variables FFish<->AS question

thanks for your help! it's greatly appreciated.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:08 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.