help with fwd/backwrd buttons affecting other buttons

This is a discussion on "help with fwd/backwrd buttons affecting other buttons" within the Flash & Multimedia Forum section. This forum, and the thread "help with fwd/backwrd buttons affecting other buttons are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 2nd, 2007, 15:28
New Member
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
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: Select all
//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--;
    }
};
Reply With Quote

  #2 (permalink)  
Old Feb 2nd, 2007, 15:42
Reputable Member
Join Date: May 2006
Location: NC, USA
Age: 16
Posts: 355
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to MrMadison Send a message via MSN to MrMadison Send a message via Skype™ to MrMadison
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?
Reply With Quote
  #3 (permalink)  
Old Feb 2nd, 2007, 15:47
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: help with fwd/backwrd buttons affecting other buttons

Also a link would be of the up most of help...thanks!!
Reply With Quote
  #4 (permalink)  
Old Feb 2nd, 2007, 15:52
New Member
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Attached Files
File Type: zip timeline7.zip (12.2 KB, 35 views)
Reply With Quote
  #5 (permalink)  
Old Feb 2nd, 2007, 15:53
New Member
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Re: help with fwd/backwrd buttons affecting other buttons

oh...and I'm using flash 8 professional.
Reply With Quote
  #6 (permalink)  
Old Feb 4th, 2007, 03:48
Reputable Member
Join Date: May 2006
Location: NC, USA
Age: 16
Posts: 355
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to MrMadison Send a message via MSN to MrMadison Send a message via Skype™ to MrMadison
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
Reply With Quote
Reply

Tags
array, backward, buttons, cycle, forward

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with buttons in flash VanHype Flash & Multimedia Forum 1 Feb 27th, 2008 22:34
help with buttons within buttons jpixel Flash & Multimedia Forum 1 Sep 20th, 2007 14:53
Why are all the buttons at the top? Jellyfishin Webforumz Cafe 6 May 30th, 2007 14:01
Flash buttons R8515198 Flash & Multimedia Forum 5 May 20th, 2007 23:53
CSS Buttons Galaxyblue Web Page Design 29 Feb 13th, 2004 14:02


All times are GMT. The time now is 04:31.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43