button inside a sliding bar doesn't work

  • meAsking
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Feb 17, 2004
  • Posts: 38
  • Status: Offline

Post April 23rd, 2004, 11:45 am

Hello good flashers,

(tried to search for it - no results)
I have a sliding bar with a MC inside it.
once you click this MC something blinks. The problem is that nothing happens when i click the MC. When I mark out the sliding bar it works. So I have a feeling it's related to the onEnterFrame in the sliding bar command (I never really fully understood this onEnterFrame thing...)

How would I solve this? do i need to delete the onEnterFrame? i tried. didn't work.
Code: [ Select ]
tpSlide.onRelease = function() {
        this.onEnterFrame = function() {
            this.speedX = (this.speedX*this.friction)+(this.baseX-this._x)*this.ratio;
            this._x += this.speedX;
        };
};
tpSlide.tp1.onRelease = function() {
    dr1.gotoAndPlay(10);
};
  1. tpSlide.onRelease = function() {
  2.         this.onEnterFrame = function() {
  3.             this.speedX = (this.speedX*this.friction)+(this.baseX-this._x)*this.ratio;
  4.             this._x += this.speedX;
  5.         };
  6. };
  7. tpSlide.tp1.onRelease = function() {
  8.     dr1.gotoAndPlay(10);
  9. };

Thank you
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 23rd, 2004, 11:45 am

  • meAsking
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Feb 17, 2004
  • Posts: 38
  • Status: Offline

Post April 23rd, 2004, 4:31 pm

So my code grew a bit and I am still pulling my hair trying to find a solution.

so "tdSlide" slides into the stage elastically (pretty cool;-) but tpSlide[b].onRelsease below it doesn't happen. why oh why? I tried to delate the enterFrame - no. I tried to set a boolean variable - no.

Please please help...

Code: [ Select ]
tpSlide.onRelease = function() {
    this.onEnterFrame = function() {
        this.speedX = (this.speedX*this.friction)+(this.baseX-this._x)*this.ratio;
        this._x += this.speedX;
    };
};
function blink(num) {
    _root["dr"+num].gotoAndPlay(2);
}
for (var j = 1; j<7; j++) {
    b = "tp"+j;
    tpSlide[b].id = j;
    tpSlide[b].onRelease = function() {
        blink(this.id);
        };
}
  1. tpSlide.onRelease = function() {
  2.     this.onEnterFrame = function() {
  3.         this.speedX = (this.speedX*this.friction)+(this.baseX-this._x)*this.ratio;
  4.         this._x += this.speedX;
  5.     };
  6. };
  7. function blink(num) {
  8.     _root["dr"+num].gotoAndPlay(2);
  9. }
  10. for (var j = 1; j<7; j++) {
  11.     b = "tp"+j;
  12.     tpSlide[b].id = j;
  13.     tpSlide[b].onRelease = function() {
  14.         blink(this.id);
  15.         };
  16. }
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post April 23rd, 2004, 5:04 pm

Sounds sorta like a targetting issue to me. An example file showing the situation would help troubleshooting.
  • meAsking
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Feb 17, 2004
  • Posts: 38
  • Status: Offline

Post April 23rd, 2004, 5:20 pm

is there an option here to attach a .fla file?
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post April 23rd, 2004, 5:32 pm

Nope, you would have to upload to a server and link to the file :-\
  • meAsking
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Feb 17, 2004
  • Posts: 38
  • Status: Offline

Post April 23rd, 2004, 5:44 pm

test
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post April 23rd, 2004, 7:32 pm

I'm getting a 404 Not Found error.
  • meAsking
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Feb 17, 2004
  • Posts: 38
  • Status: Offline

Post April 23rd, 2004, 7:43 pm

I believe that copying the address to the ie bar rather than clicking on the link will do the job.

thanks
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post April 23rd, 2004, 7:44 pm

Nope, still a 404. Odd.
  • meAsking
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Feb 17, 2004
  • Posts: 38
  • Status: Offline

Post April 23rd, 2004, 7:47 pm

sorry, i realized there were problems with the file. here is a new link that should work
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post April 23rd, 2004, 7:57 pm

Rofl, ok so now it works, but you must be using MX 2k4 because I am getting an Unexpected File Format error.

Flash MX 2k4 has the ability to save the .fla as Flash MX, can you do that so I can open it?
  • meAsking
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Feb 17, 2004
  • Posts: 38
  • Status: Offline

Post April 23rd, 2004, 8:02 pm

ok I saved as MX. a message came up saying that the file will lose data in the conversion. I hope it all works as you open it.
note: i moved the menu to the center of stage but eventually it'll be out of the stage on the right with only a piece of it sticking out to be pressed.

let me know if it opens.
:D
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Joined: Dec 29, 2003
  • Posts: 5169
  • Loc: SC-USA
  • Status: Offline

Post April 23rd, 2004, 9:17 pm

I'm sure lostinbeta's answer will be the definitive one, but I think the problem is you're trying to evalutate for multiple onRelease events and in effect it's only evalutating the event singularly on the tpSlide MC.

That's my guess anyway.


btw: I did think the slide was pretty cool. ;)
- dM
  • meAsking
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Feb 17, 2004
  • Posts: 38
  • Status: Offline

Post April 23rd, 2004, 9:34 pm

hey thanks digitalMedia.

you know, I thought that in programming (which is new in my world) every actions is executed following a hierarchy so I figured that once flash reads the first onReleased command, it'll finish and then go to the next one and execute it. I guess its more abstract then I think.
Life couldn't be that easy. :?
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Joined: Dec 29, 2003
  • Posts: 5169
  • Loc: SC-USA
  • Status: Offline

Post April 24th, 2004, 9:44 am

meAsking wrote:
hey thanks digitalMedia.

you know, I thought that in programming (which is new in my world) every actions is executed following a hierarchy so I figured that once flash reads the first onReleased command, it'll finish and then go to the next one and execute it. I guess its more abstract then I think.
Life couldn't be that easy. :?


hehehe. Yes, I would expect logic to logical as well. But then again, when we use Flash, we're only working within the logic of the people at Macromedia who develop Flash.

If my assertion is correct, you might be able to get rid of the tpSlide container and apply you're slide function to each button in unison to achieve the same effect.

btw: You might consider increasing the frame rate to 24fps. When I was playing with your file last night, it seemed be a little smoother that way.

Good Luck, and please let us know when you're done with this so we can have a look.
- dM
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 24th, 2004, 9:44 am

Post Information

  • Total Posts in this topic: 21 posts
  • Users browsing this forum: No registered users and 31 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.