PDA

View Full Version : jsfl can do it?


craigdsp
07-29-2005, 12:30 PM
i was just wondering, i've never used jsfl before, but could definatley use, i've made a template for a flash file which we use here at my studio for visualisations, the only things which need changing to re-purpose it are the images contained thier titles and the background colour. can i use jsfl to create a "make presentation from these" command that will basically take an empty flash document with nothing but a few imported jpgs in it, and turn that into my flash presentation???? (so it would resize the document, set the frame rate, promt for bg colour, show each image and promt for title, then add keyframes and actionscript to the movie, complie and test????)

or is that imposible?

craigdsp
08-01-2005, 07:46 AM
so does anyone know if jsfl can help me? is what i'm describing possible using jsfl, or am i barking up the wrong tree???

jjbilly
08-01-2005, 10:26 AM
It's the right tree you're barking up! If what you're talking about is a tool that takes user settings and makes the presentation accordingly, you'll maybe want to look at WindowSWFs.

craigdsp
08-02-2005, 09:05 AM
widowSWF's i keep hearing this term but haven't had time to investigate, am i right in thinking this is the swf's which play in the IDE as panels? if so than yes, building a swf panel (windowSWF) which accepts a library item referance and label (however many times are needed) and a bg colour, which affter hitting "build presentation" would build it, yes that would be perfect!!!

i guess so long as jsfl can do the following it's possible right?

manipulate the timeline
manipulate actionscript
manipulate the stage and document settings

i mean those are the only things which really need to be done in order to make it work, it's just they need to be done programatically(?) not by a human.

hangalot
08-02-2005, 10:35 AM
i right in thinking this is the swf's which play in the IDE as panels

yes

anipulate the timeline
manipulate actionscript
manipulate the stage and document settings

yes

when using windowswf you use MMExecute to call jsfl scripts. i attach my class i use to do it with

class Communications {

public static function executeJSFL()
{
var file = arguments.shift();
var func = arguments.shift();
var result;
if( arguments.length > 0 )
{
var arg = arguments.join( "\',\'" );
result = MMExecute(((((("fl.runScript(fl.configURI+\'WindowSWF/" + file) + "\',\'") + func) + "\',\'") + arg) + "\');");
}
else
{
result = MMExecute(((("fl.runScript(fl.configURI+\'WindowSWF/"+ file) + "\',\'") + func) + "\');");
}

return( result );
}
/*
i have a trace in the debug class as well, this one i use for warning messages to the user the other
for normal debug
*/
public static function flTrace(str)
{

MMExecute("fl.trace(unescape(\""+ escape(str)+"\"));");

}

}



you call it like this

Communications.executeJSFL("jsflFileName.jsfl","functionName",arg1,arg2);

craigdsp
08-02-2005, 12:25 PM
so presuemably i just create a panel i want to use as as a windowSWF, have some function calls to jsfl scripts which do the leg work, which sounds fine, except that panel would in itself need to interact with the ide no?

like i drag my screenshots onto it, or i pick them and give each one a title then hit build. how can i do that if the panel can only call external jsfl via MMExecute() ???

hangalot
08-02-2005, 12:36 PM
panel would in itself need to interact with the ide no?

yes via jsfl you can send stuff. as to listenening to the ide, thats trickier, setInterval can work for this, but i warn you, that can open a can of worms

craigdsp
08-02-2005, 01:29 PM
ok opening a can of worms is not a nice idea, and it's never going to be forward facing anyway, so i guess that level of "ease of use" isn't paramount. so i guess what i'm trying to work out (now that i have established it's at least possible) is what is the best approach?

i guess (correct me if i'm wrong) that i could just import my however many screen shots into the fla (they would be named seqentially anyway) and then have my "build presentation" button just look for instances of bitmap library items beggining with "screen" and from that do it right? or even easier would be to put them in a folder? or even easier still tell jsfl how many there are via the windowSWF, and at the same time get the titles (so user types 5 into an input field .onKillFocus tells the windowSWF yo put 5 input fields one after another and the values of these will be sent to jsfl for the titles)

is this sounding viable to you? am i looking at it the right way (as mentioned i've not ever worked with this sort of thing and although essentially just ecma script, it's the ide / file / code relationships which are confusing me at times, the concept of programming my program are a bit of a headFrench Connection UK ;) )

hangalot
08-02-2005, 02:13 PM
yeah it sounds viable. i don't think there is a right and wrong only a more intuative and less so