PDA

View Full Version : Point reveal on key press



PixelSense
July 11th, 2005, 01:24 PM
_root.myDepth += 100;
_root.myListener10 = new Object();
Key.addListener(_root.myListener10);
_root.mycurpoint = 0;
pointerrs = function () {
for (z=0; z<(_root.myprod_array.length); z++) {
this.pointer.duplicateMovieClip("pointer_"+z, _root.myDepth+z);
this["pointer_"+z].txt = _root.myprod_array[z];
this["pointer_"+z].txtin.multiline = true;
this["pointer_"+z].txtin.wordWrap = true;
this["pointer_"+z].txtin.autoSize = "left";
this["pointer_"+z]._x = 315;
this["pointer_"+z]._alpha = 10;
if (z == 0) {
this["pointer_"+z]._y = 220;
this["pointer_"+z].ori_y = 210;
this.onEnterFrame = function() {
this["pointer_"+z]._y += ((this["pointer_"+z].ori_y+15)-this["pointer_"+z]._y)/4;
this["pointer_"+z]._alpha += (100-this["pointer_"+z]._alpha)/4;
};
} else {
this["pointer_"+z].showPoints();
this["pointer_"+z]._y = this["pointer_"+(z-1)]._y+10+this["pointer_"+(z-1)].txtin._height;
this["pointer_"+z].ori_y = this["pointer_"+(z-1)]._y+this["pointer_"+(z-1)].txtin._height;
trace(this["pointer_"+z]+" = "+this["pointer_"+(z-1)].txtin._height);
}
}
};
pointerrs();
MovieClip.prototype.fadein = function() {
this.onEnterFrame = function() {
this._y += ((this.ori_y+15)-this._y)/4;
this._alpha += (100-this._alpha)/4;
};
};
MovieClip.prototype.showPoints = function() {
_root.myListener10.onKeyDown = function() {
if (Key.getAscii() == "32") {
_root.container["pointer_"+_root.mycurpoint].fadein();
}
_root.mycurpoint++;
};
};

i want it such that when the movie loads, the first point will fade in....
the rest of the points will only fade in on keydown, one by one.
But seems that when i reload the movie, and press keydown, the point will appear two by two... then on reload again, it appears by three by three.

Is there a better way to write the script?

I'm puzzled! can someone pls enlighten??? i'm going nuts... sobs

thanx in advance

PixelSense
July 11th, 2005, 01:52 PM
here are the files are here...
http://h-y-p-h-e-n-s.net/fla

Run main.swf, skip the intro, go to Products, click on Bridex.... and then click on any product to go to the points page.

The product_bridex.fla is where i have problems with... the part where i want the first point to fade in automatically... then the rest of the points will appear subsequently on each keypress of spacebar....

thank you so much!!!

PixelSense
July 11th, 2005, 05:52 PM
someone pls help :)