visualizer03
03-21-2009, 04:32 PM
I have a flash swf that I am using Tweener to move a wide movieclip across the stage incrementally - accessing a forward arrow and backward arrow with the following code. It works perfectly for what I am trying to accomplish. The long movie clip is composed of Image and Movieclip symbols. I am working in Action Script 2.0
In addition to the above funcitonality I am also needing to have a button on the second movieclip (click the arrow once and on that "screen") that allows for an image gallery to fill the screen (I'm using the SlideShow pro component). From this gallery screen, I also need a button that closes the gallery and returns to the main movieclip with arrow controls.
I'm not sure how to add that functionality to the code. When I try making a button symbol and giving it on press functionality it does not work. Can someone help me?
The file was larger than 100kb even when zipped, but the code is below:
I can email you the file if needed.
Thanks!
import caurina.transitions.Tweener;
// Setup buttons
this.bBackward.onRollOver = function() {
Tweener.addTween(this, {_alpha:100, time:0.6});
};
this.bBackward.onRollOut = this.bBackward.onReleaseOutside = function() {
Tweener.addTween(this, {_alpha:100, time:0.6});
};
this.bBackward.onRelease = function() {
this._parent.scrollList(-1);
};
this.bForward.onRollOver = function() {
Tweener.addTween(this, {_alpha:100, time:0.6});
};
this.bForward.onRollOut = this.bForward.onReleaseOutside = function() {
Tweener.addTween(this, {_alpha:100, time:0.6});
};
this.bForward.onRelease = function() {
this._parent.scrollList(+1);
};
// Setup data (amount of arrow clicks)
this.currentPosition = 0;
this.maxPosition = 6;
// Moving functions
this.scrollList = function(p_offset:Number): Void {
this.gotoPosition(this.currentPosition + p_offset);
};
this.gotoPosition = function(p_position:Number): Void {
// Goes to a certain position
p_position = p_position < 0 ? 0 : p_position > this.maxPosition ? this.maxPosition : p_position;
if (p_position != this.currentPosition) {
this.currentPosition = p_position;
Tweener.addTween(this.itemList, {_x:4298.4 - (this.currentPosition * 745.0), time:3.0, transition:"easeoutback"});
}
};
this.stop();
};
In addition to the above funcitonality I am also needing to have a button on the second movieclip (click the arrow once and on that "screen") that allows for an image gallery to fill the screen (I'm using the SlideShow pro component). From this gallery screen, I also need a button that closes the gallery and returns to the main movieclip with arrow controls.
I'm not sure how to add that functionality to the code. When I try making a button symbol and giving it on press functionality it does not work. Can someone help me?
The file was larger than 100kb even when zipped, but the code is below:
I can email you the file if needed.
Thanks!
import caurina.transitions.Tweener;
// Setup buttons
this.bBackward.onRollOver = function() {
Tweener.addTween(this, {_alpha:100, time:0.6});
};
this.bBackward.onRollOut = this.bBackward.onReleaseOutside = function() {
Tweener.addTween(this, {_alpha:100, time:0.6});
};
this.bBackward.onRelease = function() {
this._parent.scrollList(-1);
};
this.bForward.onRollOver = function() {
Tweener.addTween(this, {_alpha:100, time:0.6});
};
this.bForward.onRollOut = this.bForward.onReleaseOutside = function() {
Tweener.addTween(this, {_alpha:100, time:0.6});
};
this.bForward.onRelease = function() {
this._parent.scrollList(+1);
};
// Setup data (amount of arrow clicks)
this.currentPosition = 0;
this.maxPosition = 6;
// Moving functions
this.scrollList = function(p_offset:Number): Void {
this.gotoPosition(this.currentPosition + p_offset);
};
this.gotoPosition = function(p_position:Number): Void {
// Goes to a certain position
p_position = p_position < 0 ? 0 : p_position > this.maxPosition ? this.maxPosition : p_position;
if (p_position != this.currentPosition) {
this.currentPosition = p_position;
Tweener.addTween(this.itemList, {_x:4298.4 - (this.currentPosition * 745.0), time:3.0, transition:"easeoutback"});
}
};
this.stop();
};