Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » BOTTOM sliding panel.


BOTTOM sliding panel.

Reply
  #1 (permalink)  
Old 05-20-08, 11:29 AM
TheMexican TheMexican is offline
New Member
 
Join Date: Apr 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
BOTTOM sliding panel.

Hiya twsg-

Thanks for the reply.

Well I took care of that problem, but now I have a new one. Can you help me or should I post this?

Check out what I have so far:
http://www.roy-trainer.com/HelenNewm...enNewman3.html

It seems the TOP panel will not slide down unless you roll Over the BOTTOM panel first...weird.


script - Init/Top & Bottom
ActionScript Code:
  1. import mx.transitions.Tween;
  2. import mx.transitions.easing.*;
  3. //tween object that i'm using on the btn functions.
  4. var panelYpos:Tween;
  5. var panelBottomYpos:Tween;
  6. //
  7. var downLine:Number = 70;// the ypos the mouse has to cross for the panel to drop.
  8. var bttmupLine:Number = 510;// the ypos the mouse has to cross for the panel to rise.
  9. //
  10. var upLine:Number = panel._height;//the ypos the mouse has to cross for the panel to fly up.
  11. var bttmdownLine:Number = panelBottom._height;//the ypos the mouse has to cross for the panel to go down.
  12. //
  13. var upPos:Number = panel._y;// the ypos of the panel when it is out of sight, my mc is placed on the stage in this statring pos.
  14. var bttmdownPos:Number = panelBottom._y;// the ypos of the panel when it is out of sight, my mc is placed on the stage in this starting pos on the bottom.
  15. //
  16. var downPos:Number = 0;// the ypos of the TOP panel when it is down.
  17. var bttmupPos:Number = 560;// the ypos of the BOTTOM panel when it is up.
  18. //
  19. var upPosbtn2:Number = -140;//i changed the registration point of the slidepanel mc.
  20. var downPosbtn2:Number = panel.slidepanel._y;//the ypos of the panel when the the other button are pushed.
  21. //
  22. //load in the inital panel mc.
  23. var whichMenu:MovieClip = panel.infoHolder.attachMovie("introTxt", "introTxt", 1);
  24. //keeps track of which panel btn is active, initially the introTxt is active.
  25. var btnOn:MovieClip = panel.btn1;
  26. panel.btn1.gotoAndStop("isOn");

script - function/Top & Bottom
ActionScript Code:
  1. import mx.transitions.Tween;
  2. import mx.transitions.easing.*;
  3. //
  4. //moves panel
  5. panel.onEnterFrame = function() {
  6.  
  7.     if (this.isdown == false) {
  8.  
  9.         if (_root._ymouse<=downLine) {
  10.             panelYpos = new Tween(panel, "_y", Regular.easeOut, panel._y, downPos, .5, true);
  11.             this.isdown = true;
  12.         }
  13.     } else {
  14.         if (_root._ymouse>upLine) {
  15.             panelYpos = new Tween(panel, "_y", Regular.easeOut, panel._y, upPos, .5, true);
  16.             this.isdown = false;
  17.         }
  18.     }
  19. };
  20.  
  21. //moves bottom panel
  22. panelBottom.onEnterFrame = function() {
  23.  
  24.     if (this.isdown == false) {
  25.         if (_root._ymouse>bttmupLine) {
  26.             panelBottomYpos = new Tween(panelBottom, "_y", Regular.easeOut, panelBottom._y, bttmupPos, .5, true);
  27.             this.isdown = true;
  28.         }
  29.     } else {
  30.         if (_root._ymouse<(bttmupPos-bttmdownLine)) {
  31.             panelBottomYpos = new Tween(panelBottom, "_y", Regular.easeOut, panelBottom._y, bttmdownPos, .5, true);
  32.             this.isdown = false;
  33.         }
  34.     }
  35. };

Last edited by UnrealEd; 05-20-08 at 11:31 AM. Reason: please use the [highlight=ActionScript] wrapper
Reply With Quote
  #2 (permalink)  
Old 05-20-08, 11:34 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
[SPLIT] Please do not start new topics about a question you just asked in another thread.


I'm not sure, but I think it has something to do with the fact that the this.isdown variable isn't set when in the onEnterFrame event
When it isn't set, it will return "undefined", and not false

As I said, I'm not sure
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks


Last edited by UnrealEd; 05-20-08 at 11:59 AM.
Reply With Quote
  #3 (permalink)  
Old 05-20-08, 12:25 PM
thatwebsitegirl thatwebsitegirl is offline
New Member
 
Join Date: May 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
why don't you just try reversing your conditional statement and checking for isDown == true ? Then it won't matter if isDown is false or undefined; the else statement will catch either.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm having trouble with rollover sliding panel. TheMexican Flash & ActionScript 1 05-20-08 11:11 AM
Select radioButton, switch panel in C#/.net bscsGrad Windows .NET Programming 4 08-22-06 08:31 PM
Free windows hosting contorl panel parsv ASP 0 09-10-05 03:54 AM
I Need Control Panel Layout Patiek Job Offers & Assistance 1 01-24-05 02:32 PM


All times are GMT -5. The time now is 06:41 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.