Flash Actionscript 3 (will pick best answer)?

aboutthismac

New member
I WILL PICK BEST ANSWER!!!

I have 2 movie clips and i need a variable from movie clip 1 (login_mc) to be the same on movie clip 2(messages_mc)
(logon. no database needed, all usernames are in code)

here is my code

/////////main scene//
function checkVariable(event:Event):void
{
messages_mc.user = login_mc.usernamevar;
}



///////////login screen movie clip//
login_btn.addEventListener(MouseEvent.CLICK, onCLICK);

function onCLICK(event:MouseEvent){

var usernamevar:String = username_txt.text;
var passwordvar:String = password_txt.text;

if(usernamevar == "user1" && passwordvar == "password"){
gotoAndPlay(2);
}else if(usernamevar == "user2" && passwordvar == "password"){
gotoAndPlay(2);
}else{
wrongPass_mc.gotoAndPlay(2);
}
}



////////////////logon movie clip moves out of way and the main scene moves to next frame to show the messages_mc


///////////////messages_mc///
test_btn.addEventListener(MouseEvent.CLICK, onCLICK);

var user:String;

(this.parent as MovieClip).checkVariable();

function onCLICK(event:MouseEvent){
welcome_txt.text = "welcome" + " " + user;
}





But I am getting an error:
ArgumentError: Error #1063: Argument count mismatch on iphoneapp3_fla::MainTimeline/checkVariable(). Expected 1, got 0.
at iphoneapp3_fla::messages_mc_6/frame1()
at flash.display::MovieClip/gotoAndPlay()
at iphoneapp3_fla::screen_mc_1/frame15()

please help!
 
Back
Top