A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Only 1 of 3 Buttons Appears

  1. #1
    Junior Member
    Join Date
    Jan 2016
    Location
    Canada
    Posts
    4

    resolved [RESOLVED] Only 1 of 3 Buttons Appears

    Hello! I am using Adobe Flash Professional CS6 and ActionScript 2.0. I have three buttons on Scene 1: trgtbtn0, trgtbtn1 and trgtbtn2. Only the button in the higher layer appears in the middle. If trgtbtn1's layer was at the top, it would be the only one in the middle. If trgtbtn2's layer was at the top, it would be the only one in the middle. I suspect it has to do with this part of my code, where when you move your mouse one way the objects listed move the other way:
    Code:
    onEnterFrame = function(){
    	bgmc._x = -_xmouse+Stage.width;
    	bgmc._y = -_ymouse+Stage.width;
    	trgt0btn._x = -_xmouse+Stage.width;
    	trgt0btn._y = -_ymouse+Stage.width;
    	trgt1btn._x = -_xmouse+Stage.width;
    	trgt1btn._y = -_ymouse+Stage.width;
    	trgt2btn._x = -_xmouse+Stage.width;
    	trgt2btn._y = -_ymouse+Stage.width;
    	ChkMrk0mc._x = -_xmouse+Stage.width;
    	ChkMrk0mc._y = -_ymouse+Stage.width;
    	ChkMrk1mc._x = -_xmouse+Stage.width;
    	ChkMrk1mc._y = -_ymouse+Stage.width;
    	ChkMrk2mc._x = -_xmouse+Stage.width;
    	ChkMrk2mc._y = -_ymouse+Stage.width;
    }
    Here is the code for the scene.
    Code:
    onEnterFrame = function(){
    	bgmc._x = -_xmouse+Stage.width;
    	bgmc._y = -_ymouse+Stage.width;
    	trgt0btn._x = -_xmouse+Stage.width;
    	trgt0btn._y = -_ymouse+Stage.width;
    	trgt1btn._x = -_xmouse+Stage.width;
    	trgt1btn._y = -_ymouse+Stage.width;
    	trgt2btn._x = -_xmouse+Stage.width;
    	trgt2btn._y = -_ymouse+Stage.width;
    	ChkMrk0mc._x = -_xmouse+Stage.width;
    	ChkMrk0mc._y = -_ymouse+Stage.width;
    	ChkMrk1mc._x = -_xmouse+Stage.width;
    	ChkMrk1mc._y = -_ymouse+Stage.width;
    	ChkMrk2mc._x = -_xmouse+Stage.width;
    	ChkMrk2mc._y = -_ymouse+Stage.width;
    }
    onLoad = function() {
    _global.Chk0 = false;
    _global.Chk1 = false;
    _global.Chk2 = false;
    ChkMrk0mc._alpha = 0;
    ChkMrk1mc._alpha = 0;
    ChkMrk2mc._alpha = 0;
    }
    if(_global.Chk0 == false){
    	ChkMrk0mc._alpha = 0;
    	trgt0btn.enabled = true;
    }
    if(_global.Chk1 == false){
    	ChkMrk1mc._alpha = 0;
    	trgt1btn.enabled = true;
    }
    if(_global.Chk2 == false){
    	ChkMrk2mc._alpha = 0;
    	trgt2btmcn.enabled = true;
    }
    if(_global.Chk0 == true){
    	ChkMrk0mc._alpha = 100;
    	trgt0btn.enabled = false;
    }
    if(_global.Chk1 == true){
    	ChkMrk1mc._alpha = 100;
    	trgt1btn.enabled = false;
    }
    if(_global.Chk2 == true){
    	ChkMrk2mc._alpha = 100;
    	trgt2btn.enabled = false;
    }
    stop();
    For some reason I can't upload the flash file. Thanks in advance.
    Capture.jpgCapture0.jpg

  2. #2
    Junior Member
    Join Date
    Jan 2016
    Location
    Canada
    Posts
    4
    Never mind. Essentially, I had to go + 400 and -400 the stage.width

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center