Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Visual Design > Flash and ActionScript

Reply
 
LinkBack Thread Tools
Old 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 typeofdoug is on a distinguished road
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--;
    }
};
typeofdoug is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 MrMadison will become famous soon enough MrMadison will become famous soon enough
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?
MrMadison is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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
Rep Altering Power: 0 JacobHaug is a jewel in the rough JacobHaug is a jewel in the rough JacobHaug is a jewel in the rough JacobHaug is a jewel in the rough
Re: help with fwd/backwrd buttons affecting other buttons

Also a link would be of the up most of help...thanks!!
JacobHaug is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 typeofdoug is on a distinguished road
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)
typeofdoug is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 typeofdoug is on a distinguished road
Re: help with fwd/backwrd buttons affecting other buttons

oh...and I'm using flash 8 professional.
typeofdoug is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 MrMadison will become famous soon enough MrMadison will become famous soon enough
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
MrMadison is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
array , backward , buttons , cycle , forward


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 and ActionScript 1 February 27th, 2008 06:34 PM
help with buttons within buttons jpixel Flash and ActionScript 1 September 20th, 2007 10:53 AM
Why are all the buttons at the top? Jellyfishin The Café 6 May 30th, 2007 10:01 AM
Flash buttons R8515198 Flash and ActionScript 5 May 20th, 2007 07:53 PM
CSS Buttons Galaxyblue HTML, XHTML and CSS 29 February 13th, 2004 10:02 AM


Search Engine Optimization by vBSEO 3.2.0 RC8