View Full Version : Somewhat of a Newbie
Lovebev1
03-22-2006, 04:14 AM
This question may have been answered somewhere on this forum, but I am approaching a deadline. I am creating a site for a client who would like to have their site look something like www.gucci.com.
My questions are: 1. How do I get the sliding panel to stop on a click and start again on another click?
2. When a user clicks on the picture, how can I get the images to change?
3. Is it better to use scenes or additional pages for the "About Us and Contact Us, etc. buttons?
I need to have a functional site by May 31st. I already have the homepage designed, just need some assistance.
Thanks,
Lovebev1
icemart525
03-22-2006, 08:07 AM
mostly the animations in the site are ._alpha tween and _xscale tween. you should be more specific to your questions. Ü
Lovebev1
03-22-2006, 12:00 PM
Okay,
what code do I use to get the sliding panel to stop and a user clicks on it and start again when a user clicks on it?
secondly, what code is needed to get the images to change when a user clicks on the image?
icemart525
03-23-2006, 12:49 AM
what code do I use to get the sliding panel to stop and a user clicks on it and start again when a user clicks on it?
definitely you'll use AS code hehehe.
first you have to declare a flag variable:
say var clicked:Number = -1; then change this in the onRelease or onPress event:
this.slider_mc.onRelease = function() {
if (clicked == -1) {
clicked = 1; //set to 1 when slider is stopped
slider_mc.StopMe; // call your method to stop the movie
// or slider_mc.gotoAndStop('frameName');
} else {
clicked = -1;
slider_mc.StartMe; // call method to play
//or slider_mc.gotoAndPlay('frameName');
} // set to -1 when started
}
secondly, what code is needed to get the images to change when a user clicks on the image?
there's a lot of ways to do this, you can load the image by using loadMovie, or you can put them in the stage and set their ._alpha to 0 or ._visible = false; and then onMouseEvent you can fade them in or use any effects you know. hope this helps. cheers! :)
Lovebev1
03-23-2006, 02:04 PM
This is the script that I have that makes the panel slide back and forth. What can I add to this script that will make the panel stop when a user clicks on it or start again when the user clicks again? Can I use the script that was given?
speed = 15;
imageMask.onEnterFrame = function() {
if ((this._width + this._x) < _xmouse) {
if (this._width + this._x >= _xmouse - 0.5) {
this._x = _xmouse - this._width;
} else {
this._x += (_xmouse - (this._width + this._x)) / speed;
}
} else if ((this._width+this._x) > _xmouse) {
if ((this._width + this._x) <= _xmouse + 0.5) {
this._x = _xmouse - this._width;
} else {
this._x -= ((this._width + this._x) - _xmouse) / speed;
}
} else {
this._x = _xmouse - this._width;
}
};
icemart525
03-24-2006, 12:04 AM
you can name this as your startMe function:
speed = 15;
imageMask.onEnterFrame = function() {
if ((this._width + this._x) < _xmouse) {
if (this._width + this._x >= _xmouse - 0.5) {
this._x = _xmouse - this._width;
} else {
this._x += (_xmouse - (this._width + this._x)) / speed;
}
} else if ((this._width+this._x) > _xmouse) {
if ((this._width + this._x) <= _xmouse + 0.5) {
this._x = _xmouse - this._width;
} else {
this._x -= ((this._width + this._x) - _xmouse) / speed;
}
} else {
this._x = _xmouse - this._width;
}
};
and then for your stopMe function:
you assign the current values of the MC to its current state. ;)
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.