  | |  | Re: Creating WindowSWF frameLabel | Re: Creating WindowSWF frameLabel
2004-06-17 - By John Grden
Back Hey Jay, I would do it like this:
function click() {
//Obtain the values from the form
var frmLabelType_as:String
var frmLabelName_as:String
if (labelType_cb.value != null)
{
frmLabelType_as = labelType_cb.value;
trace(frmLabelType_as);
}
if (labelName_ti.value != null)
{
frmLabelName_as = labelName_ti.text;
trace(frmLabelName_as);
}
var
str:String= "fl.runScript(fl.configURI+\ "WindowSwf/LabelScript.jsfl\ ",\ "initLayer\ ", \ " "+frmLabelName_as+ "\ ",\ " "+frmLabelType_as+ "\ "); "; MMExecute(str);
}
Declare your vars before the If statement so that at least you can send a null value. Then, just check for null in the control 's values. If it 's Not null, then whatever the value is will be sent. Note the addition of a function name in your runscript call.
See, whatever these values might be, MMExecute will only pass strings/integers, so, it 'll look like "null " to the JSFL file.
You need to define a function like "initLayer " or something in your JSFL file because from what I understand, runScript is expecting to open a script and use your first argument as the function name, hence, why you 're getting the double error - neither variable is a function in your JSFL file:
function initLayer(sType, sName)
{
var myFrame = fl.getDocumentDOM().timelines[0].layers[0].frames[0];
myFrame.labelType = sType;
myFrame.name = sName;
}
Hth,
John Grden
Senior Flash Developer
Macromedia Certified Flash MX Designer
Blitz Digital Studios
[e] John@(protected)
[c] 714.326.7211
[b] 818.762.6888 x207
[w] www.BlitzDS.com
[a] Blitz DS
? 11336 Camarillo Street
? Suite 200
? North Hollywood, CA 91602
> -- --Original Message-- --
> From: Extendflash-bounces@(protected) [mailto:Extendflash-
> bounces@(protected)] On Behalf Of Jay Myers
> Sent: Thursday, June 17, 2004 10:36 AM
> To: Extending Flash
> Subject: [ExtendFlash] Re: Creating WindowSWF frameLabel
>
> Hi Again,
>
> (Feeling kind of silly)
> Thank you all for your help. One more question (honest)?
> Sharon, I placed your code and I tested it.
> And.... I received an
> "undefined is not a function "
> "undefined is not a function "
> error.
>
> AS:
> Stage.align = "TL ";
> function click() {
> //Obtain the values from the form
> if (labelType_cb.value == " ") {
> var frmLabelType_as:String = "\ "\ " ";
> } else {
> var frmLabelType_as:String = labelType_cb.value;
> trace(frmLabelType_as);
> }
> if (labelName_ti.value == " ") {
> var frmLabelName_as:String = "\ "\ " ";
> } else {
> var frmLabelName_as:String = labelName_ti.text;
> trace(frmLabelName_as);
> }
> var
> str:String= "fl.runScript(fl.configURI+\ "WindowSwf/LabelScript.jsfl\ ",\ " "
> +frmLabelName_as+ "\ ",\ " "+frmLabelType_as+ "\ "); ";
> MMExecute(str);
> }
> setLabel_btn.addEventListener( "click ", this);
>
> JSFL:
> var myFrame = fl.getDocumentDOM().timelines[0].layers[0].frames[0];
> myFrame.labelType = frmLabelType_as;
> myFrame.name =frmLabelName_as;
>
>
>
> Any thoughts?
>
> Thanks,
> j
>
>
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> Extendflash mailing list
> Extendflash@(protected)
> http://flashguru.co.uk/mailman/listinfo/extendflash_flashguru.co.uk
>
> Courtesy of FlashGuru LTD.
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
Extendflash mailing list
Extendflash@(protected)
http://flashguru.co.uk/mailman/listinfo/extendflash_flashguru.co.uk
Courtesy of FlashGuru LTD.
|
|
 |