|
|
 |
February 2nd, 2007, 11:28 AM
|
#1
|
|
New Member
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
help with fwd/backwrd buttons affecting other buttons
I'm pretty new to action script and have pieced together the bellow code from tutorials and other whatnots. At the bottom you'll see my 'forward/backward' script that cycles through my array. My question is how do I put my index specific buttons in the down state while 'forward/backward' buttons do their magic?
Code:
//finds current x pos and sets speed to new x pos
Movieclip.prototype.scrollme1 = function(xPos) {
cX = this._x;
difX = cX-xPos;
this._x = cX-(difX/5);
};
Movieclip.prototype.scrollme2 = function(xPos) {
cX = this._x;
difX = cX-xPos;
this._x = cX-(difX/6);
};
stop();
//variable starting value
arrayIndex = 1;
//timeline stopping postions
timeline1Xpos = new Array(0, 0, -760, -1520, 305);
//scrolling animation
timeline1.onEnterFrame = function() {
this.scrollme1(timeline1Xpos[arrayIndex]);
};
stop();
//variable starting value
arrayIndex = 1;
//timeline stopping postions
timeline2Xpos = new Array(0, 0, -760, -1520, 305);
//scrolling animation
timeline2.onEnterFrame = function() {
this.scrollme2(timeline2Xpos[arrayIndex]);
};
//buttons that scroll the timeline to specific x positions
//but1
controller_mc.but1.onRollOver = function() {
this.frameHold = this._currentframe;
this.gotoAndStop("over");
};
controller_mc.but1.onRollOut = function() {
this.gotoAndStop(this.frameHold);
};
controller_mc.but1.onRelease = function() {
arrayIndex = 1;
for (var mc in this._parent) {
var thisHold = this;
if ((this._parent[mc] == thisHold) && (this._parent[mc]._name.indexOf("but") != -1)) {
this._parent[mc].gotoAndStop("on");
} else {
this._parent[mc].gotoAndStop("off");
}
}
this.frameHold = this._currentframe;
};
//but2
controller_mc.but2.onRollOver = function() {
this.frameHold = this._currentframe;
this.gotoAndStop("over");
};
controller_mc.but2.onRollOut = function() {
this.gotoAndStop(this.frameHold);
};
controller_mc.but2.onRelease = function() {
arrayIndex = 2;
for (var mc in this._parent) {
var thisHold = this;
if ((this._parent[mc] == thisHold) && (this._parent[mc]._name.indexOf("but") != -1)) {
this._parent[mc].gotoAndStop("on");
} else {
this._parent[mc].gotoAndStop("off");
}
}
this.frameHold = this._currentframe;
};
//but3
//
controller_mc.but3.onRollOver = function() {
this.frameHold = this._currentframe;
this.gotoAndStop("over");
};
controller_mc.but3.onRollOut = function() {
this.gotoAndStop(this.frameHold);
};
controller_mc.but3.onRelease = function() {
arrayIndex = 3;
for (var mc in this._parent) {
var thisHold = this;
if ((this._parent[mc] == thisHold) && (this._parent[mc]._name.indexOf("but") != -1)) {
this._parent[mc].gotoAndStop("on");
} else {
this._parent[mc].gotoAndStop("off");
}
}
this.frameHold = this._currentframe;
};
//
//timeline forward and backward buttons
controller_mc.goForward.onRelease = function() {
if (arrayIndex<3) {
arrayIndex++;
}
};
controller_mc.goBack.onRelease = function() {
if (arrayIndex>1) {
arrayIndex--;
}
};
|
|
|
February 2nd, 2007, 11:42 AM
|
#2
|
|
Reputable Member
Join Date: May 2006
Location: NC, USA
Age: 18
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: help with fwd/backwrd buttons affecting other buttons
So you want your index button to be pressed...while the other buttons are being used? What?
What I've gathered is that you want your Index button to be in the down state(Pushed but not released) while the Forward and backward buttons are...as you say "working their magic". Could you clarify that?
BTW- What version of flash are you using?
|
|
|
February 2nd, 2007, 11:47 AM
|
#3
|
|
Elite Veteran
Join Date: Dec 2005
Location: On Internet
Posts: 4,850
Thanks: 0
Thanked 0 Times in 0 Posts
|
Re: help with fwd/backwrd buttons affecting other buttons
Also a link would be of the up most of help...thanks!!
|
|
|
February 2nd, 2007, 11:52 AM
|
#4
|
|
New Member
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: help with fwd/backwrd buttons affecting other buttons
Thanks for your patience. Let me try explaining again.
I have a chronological timeline for a historic site. There are a series of buttons (dates) that change the x position of the timeline_mc. At either end of this series of dates, (buttons which reference the array i established for the timeline x position) I have forward and backward buttons that determine what array index number I'm at and then proceed to next index number respectively. What those fwd/bckwrd buttons don't do, which I'd like help with, is cycle through the down state look of the date buttons.
I hope I'm more clear this time. I've also attached my flash file.
|
|
|
February 2nd, 2007, 11:53 AM
|
#5
|
|
New Member
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: help with fwd/backwrd buttons affecting other buttons
oh...and I'm using flash 8 professional.
|
|
|
February 3rd, 2007, 11:48 PM
|
#6
|
|
Reputable Member
Join Date: May 2006
Location: NC, USA
Age: 18
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: help with fwd/backwrd buttons affecting other buttons
Alright! I see your problem! Sadly, I have no clue how to fix that. I have...beginning ideas. I'm not...actionscript pro man.....lol
See if this helps at all.
http://www.kirupa.com/developer/flas.../_ActionScript
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|