jsfl


execute function comes from http://blog.fuelindustries.com/archives/cat_jsfl.html

the trace function is just a rework of theirs to use esacpe and unescape.

Actionscript:
  1. public static function executeJSFL()
  2. {
  3. var file = arguments.shift();
  4. var func = arguments.shift();
  5. var result;
  6. if( arguments.length> 0 )
  7. {
  8. var arg = arguments.join( "\',\'" );
  9. result = MMExecute(((((("fl.runScript(fl.configURI+\'WindowSWF/" + file) + "\',\'") + func) + "\',\'") + arg) + "\');");
  10. }
  11. else
  12. {
  13. result = MMExecute(((("fl.runScript(fl.configURI+\'WindowSWF/"+ file) + "\',\'") + func) + "\');");
  14. }
  15.  
  16. return( result );
  17. }
  18.  
  19. public static function flTrace(str){
  20.  
  21. MMExecute("fl.trace(unescape(\""+ escape(str)+"\"));");
  22.  
  23. }

type: command

location: commands-->classBuilder

usage:

open a symbol in the ide. dbl-click the jsfl file.

a class shell like this :

Actionscript:
  1. import ucles.visual.RadioButton
  2.  
  3. import mx.controls.MediaController
  4.  
  5. import mx.containers.Accordion
  6.  
  7. class myName extends MovieClip
  8. {
  9.  
  10. private var prompt:TextField
  11.  
  12. private var questionNumber:TextField
  13.  
  14. private var optionAtxt:TextField
  15.  
  16. private var optionBtxt:TextField
  17.  
  18. private var optionA:RadioButton
  19.  
  20. private var optionB:RadioButton
  21.  
  22. private var iMedia:MediaController
  23.  
  24. private var accTest:Accordion
  25. }

will be generated in the output window, with all the necesary includes and variable declarations. all elements with an instance name will be included, if no instanceName is assigned the element will be ignored.

loads of improvements can be made int he jsfl i am certain.

the extension is availible @

http://www.lennel.org/commands/classBuilder.zip

errata:

currently buttons are declared as MC's. their interfaces are so similiar that i saw no need for otherwise.

compiled clips it searches the import library by walking through the fl.configURI+"Classes/mx/" folder recusively, thus if two similiar class names exists but with different namespaces both will be imported.

need to poll from a windowsSWF what object(s) on the stage is selected at
any given point so I can extract the actionscript from it. Thus using
setInterval I call a function to do that in a jsfl file.
Obviously I need to c how many objects are selected at any given point so I use the following lines of codevar doc = fl.getDocumentDOM(); if(doc.selection.length==1)

all straight fwd there,

the side effect is this, when accessing an the selection array I seem to be
losing the values of any properties being set in the properties pane for
symbols (x,y,width,height and instance name).

to reproduce

1. create an fla
2. on the firstframe place this code:

Actionscript:
  1. this.onEnterFrame = function(){
  2.  
  3. MMExecute("fl.getDocumentDOM().selection");
  4.  
  5. }

3. publish to the windowsSWF folder.
4. open ur new pane
5. create a symbol on the stage and try to change any of those
abovementioned properties, whilst the panel is open.

This problem has not been sorted in 7.2.