all groups > macromedia flash flash remoting > november 2004 >
You're in the

macromedia flash flash remoting

group:

remoting with flash form applications


remoting with flash form applications JKUNKE
11/29/2004 5:58:42 PM
macromedia flash flash remoting:
I am a little confused about how to access flash variables which are passed
into a swf using flashvars. I created my swf using the flash form application
where the application form has a class defined instead of inheriting the
default mx.screens.Form. I have a need to access a couple of additional
parameters besides the gatewayURL. Can I get my hands on the flash variables
within the application class I created? How would I go about doing that?

My application class looks like the following:

class oesn.Application extends mx.screens.Form {

var frmSNRecord: oesn.SNRecord;
var frmSNNotes: oesn.SNNotes;
var btnSNRecord:Button;
var btnSNNotes:Button;

function Application() {
_global.style.setStyle("themeColor", "haloOrange");
addEventListener("load", onLoad);
}

function onLoad():Void {
btnSNRecord.onRelease = function() { _parent.toolbarHandler(this); }
btnSNNotes.onRelease = function() { _parent.toolbarHandler(this); }
btnSNNotes.enabled = false;
}

function toolbarHandler(btn:Button):Void {
frmSNRecord.visible = (btn == btnSNRecord);
frmSNNotes.visible = (btn == btnSNNotes);
}
}

I know that if I were using a traditional flash document to create the swf, I
would be able to pick up the flash vars in frame 1 of the timeline. But, I
thought I would experiment with flash forms and now I am stuck, because I can't
get to my flash variables.
Any help would certainly be appreciated.
Re: remoting with flash form applications Rowan
12/3/2004 3:04:36 PM
You can try either:

_level0.application.frmSNRecord (<--- this should work, 'application' is the name of your toplevel form)

or

_root.frmSNRecord

AddThis Social Bookmark Button