what i have got now are different buttons on the stage. So far so good.
There will be more buttons in the future so i need to scroll the dynamic created mc’s. HOw do i do this??
I was thinking of creating a empty mc and this mc will hold the dynamic created mc’s. Furthermore, i would use a mask, a moveUp button and a moveDown button.
My question:
Should i use AS to produce the empty mc and the mask? Or movie instances??
Yup i guess i’d do the same. Use a master container that will hold everything and have that scrolled, with the use of masks. I dont think it matters really which way you do it, if your competent enough do it in action script.
That is the way i am trying it now. One of the things that goes wrong is the _heigth of the holder, i think.
I found this AS i want to use for the up & down
//prototype function for scrolling up button
MovieClip.prototype.moveUp = function() {
//when it enters the frame
this.onEnterFrame = function() {
//if myClip is less than or equal to howFarUp
if (myClip._y>=howFarUp) {
//delete the onEnterFrame so it can't scroll anymore
delete this.onEnterFrame;
} else {
//else keep scrolling it
myClip._y += speed;
}
};
};
//prototype function for down button
MovieClip.prototype.moveDown = function() {
//when it enters the frame
this.onEnterFrame = function() {
//if myClip._y less than or equal to howFarDown
if (myClip._y<=howFarDown) {
//delete the onEnterFrame so it can't scroll
delete this.onEnterFrame;
} else {
//else keep scrolling it
myClip._y -= speed;
}
};
};
in my case i made myClip a empty mc that holds the dynamic created mc’s.
When i change
myClip._y<=howFarDown
to
myClip._y>=howFarDown
it scrolls down but i can see the logic in that and futhermore the up does nothing.
k, i’ll explain the logic with a bit a paper. Take a piece of paper (news paper or something with text on it). Now pretend theres a mask over it, say a 6cm square in the centre. Now if you want to see whats above the mask you need to pull the paper down, and if you want to see whats below the mask you need to pull the paper up. Right?
So thats why moveDown has a -= becuase you need to move up the Y axis, remember moving up the Y axis in Flash is actually decresing the Y axis. Does that make sense?
Trust me though the logic in the script it right. And as for moveUp doing nothing its probably cos the value of howFarUp is less than the value of your movieclip at coordinate Y.
I get it with a simple static mc that’s bigger then a mask and scrolling it. But with dyn. create mc’s in a holder i don’t get it! Well i get the logic but i can get it to work correctly