Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

AS2 AS3 is it a problem

Explorer ,
Apr 19, 2019 Apr 19, 2019

hi  ive got a movie clip within it i have a mask and a scrollbar and an up and down button and a content movie clip,

in the content movie clip a designed a button and some images that become visible when the button is pressed but it does work, are the buttons not suppose to be in the content movie clip ?

TOPICS
ActionScript
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 19, 2019 Apr 19, 2019

Your question title seems to be asking about translating from as2 to as3. But the actual text is asking about where to place some buttons. In any case, and in either language, the location of the buttons is less important than the code that you are using to make the button’s action do something.

You haven’t shown us a diagram of your objects or any of the code in use, so it’s difficult to tell where the problem is. Can you provide some more specific information?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 19, 2019 Apr 19, 2019

AS2 was phased out years ago. If the question is compatibility: Actionscript 2.0 and Actionscript 3.0 are not compatible with each other. Actionscript 2.0 is deprecated with Animate CC. I think your question is not clear.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 21, 2019 Apr 21, 2019

ive a movie clip and its called

doc_creditapp_form1

inside this movie clip im running this code on a blank timeline frame 1 and undr it is my buttons and mask and content all on their own timelines on frame 1.

scrolling = function () {

  var scrollHeight:Number = scrollTrack._height;

  var contentHeight:Number = contentMain._height;

  var scrollFaceHeight:Number = scrollFace._height;

  var maskHeight:Number = maskedView._height;

  var initPosition:Number = scrollFace._y=scrollTrack._y;

  var initContentPos:Number = contentMain._y;

  var finalContentPos:Number = maskHeight-contentHeight+initContentPos;

  var left:Number = scrollTrack._x;

  var top:Number = scrollTrack._y;

  var right:Number = scrollTrack._x;

  var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y;

  var dy:Number = 0;

  var speed:Number = 10;

  var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);

  scrollFace.onPress = function() {

  var currPos:Number = this._y;

  startDrag(this, false, left, top, right, bottom);

  this.onMouseMove = function() {

  dy = Math.abs(initPosition-this._y);

  contentMain._y = Math.round(dy*-1*moveVal+initContentPos);

  };

  };

  scrollFace.onMouseUp = function() {

  stopDrag();

  delete this.onMouseMove;

  };

  btnUp.onPress = function() {

  this.onEnterFrame = function() {

  if (contentMain._y+speed<maskedView._y) {

  if (scrollFace._y<=top) {

  scrollFace._y = top;

  } else {

  scrollFace._y -= speed/moveVal;

  }

  contentMain._y += speed;

  } else {

  scrollFace._y = top;

  contentMain._y = maskedView._y;

  delete this.onEnterFrame;

  }

  };

  };

  btnUp.onDragOut = function() {

  delete this.onEnterFrame;

  };

  btnUp.onRelease = function() {

  delete this.onEnterFrame;

  };

  btnDown.onPress = function() {

  this.onEnterFrame = function() {

  if (contentMain._y-speed>finalContentPos) {

  if (scrollFace._y>=bottom) {

  scrollFace._y = bottom;

  } else {

  scrollFace._y += speed/moveVal;

  }

  contentMain._y -= speed;

  } else {

  scrollFace._y = bottom;

  contentMain._y = finalContentPos;

  delete this.onEnterFrame;

  }

  };

  };

  btnDown.onRelease = function() {

  delete this.onEnterFrame;

  };

  btnDown.onDragOut = function() {

  delete this.onEnterFrame;

  };

  if (contentHeight<maskHeight) {

  scrollFace._visible = false;

  btnUp.enabled = false;

  btnDown.enabled = false;

  } else {

  scrollFace._visible = true;

  btnUp.enabled = true;

  btnDown.enabled = true;

  }

};

scrolling();

then in the content movie clip that is under the mask, is a jpeg image on a timeline frame 1 along with alot of other drawn blocks that i put into a blue colour and made a button that makes them visible, as they each individually coded to be false, on their own timeline frame 1, the button im using has this code :

loaddataform1._visible = true;

loaddataform1.onRelease - function(){

loaddataform1._visible = false;

loaddataform1submit._visible = true;

d3_back_blue._visible = true;

cyn_back_blue._visible = true;

id_back_blue._visible = true;

bs_back_blue._visible = true;

bpa_back_blue1._visible = true;

bpa_back_blue2._visible = true;

bpa_back_blue3._visible = true;

bpa_back_blue4._visible = true;

pa_back_blue4._visible = true;

pa_back_blue3._visible = true;

pa_back_blue2._visible = true;

pa_back_blue._visible = true;

ppcns_back_blue._visible = true;

pppea_back_blue._visible = true;

pppln_back_blue._visible = true;

pppcn_back_blue._visible = true;

pppfx_back_blue._visible = true;

oppns_back_blue._visible = true;

oppea_back_blue._visible = true;

oppln_back_blue._visible = true;

oppln_back_blue._visible = true;

oppcn_back_blue._visible = true;

fxn_back_blue._visible = true;

d2_back_blue._visible = true;

sig_back_blue._visible = true;

an_back_blue._visible = true;

pns_back_blue._visible = true;

an_back_blue._visible = true;

wns_back_blue._visible = true;

aia_back_blue._visible = true;

wea_back_blue._visible = true;

wtn_back_blue._visible = true;

ws_back_blue._visible = true;

msph_back_blue._visible = true;

aia_back_blue._visible = true;

d1_back_blue._visible = true;

aof_back_blue._visible = true;

}

and the data text backrounds which are in blue are not becoming visible, nor is the submit button which has this code on :

loaddataform1submit._visible = false;

loaddataform1submit.onRelease - function(){

loaddataform1submit._visible = false;

d3_back_blue._visible = false;

cyn_back_blue._visible = false;

id_back_blue._visible = false;

bs_back_blue._visible = false;

bpa_back_blue1._visible = false;

bpa_back_blue2._visible = false;

bpa_back_blue3._visible = false;

bpa_back_blue4._visible = false;

pa_back_blue4._visible = false;

pa_back_blue3._visible = false;

pa_back_blue2._visible = false;

pa_back_blue._visible = false;

ppcns_back_blue._visible = false;

pppea_back_blue._visible = false;

pppln_back_blue._visible = false;

pppcn_back_blue._visible = false;

pppfx_back_blue._visible = false;

oppns_back_blue._visible = false;

oppea_back_blue._visible = false;

oppln_back_blue._visible = false;

oppln_back_blue._visible = false;

oppcn_back_blue._visible = false;

fxn_back_blue._visible = false;

d2_back_blue._visible = false;

sig_back_blue._visible = false;

an_back_blue._visible = false;

pns_back_blue._visible = false;

an_back_blue._visible = false;

wns_back_blue._visible = false;

aia_back_blue._visible = false;

wea_back_blue._visible = false;

wtn_back_blue._visible = false;

ws_back_blue._visible = false;

msph_back_blue._visible = false;

aia_back_blue._visible = false;

d1_back_blue._visible = false;

aof_back_blue._visible = false;

}

I still need to add a text input on top of each backround and add the code to the button that loads the text inputs then and the text input backrounds which are in blue, i want to further my data entered by adding a code onto the submit button to send the data so it can be stored, but my question is my button is inactive in its movie clip that is under a mask in another movie clip, do i need to lift the buttons and text input backrounds out the content movie clip and put in under the mask on top of the jpeg content movie clip ?, will my buttons work then? or is there some thing else i need to do to get it to work from where it is currently situated. ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 21, 2019 Apr 21, 2019

I see i didnt have a = on the buttons function, i had a minus by accident, its working just fine now that i put the equal sign in place of the minus,Ive not made the text inputs yet and will do so soon, and need help getting it stored.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2019 Apr 21, 2019

It looks like you’re using AS2 here. What version of Flash are you using? I haven’t worked in AS2 in many, many, years. What is it that you need help in getting stored? If it is the values in the text inputs, you can assign a variable to each text input and then refer to that variable’s value.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 21, 2019 Apr 21, 2019
LATEST

yes i want to store info numbers and words in the swf file if possible,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines