Flash Can't Reach The Button

I’m experiencing a problem with my inventory system. I have a inventory that will hide/show itself whenever the mouse is over it. And inside “inventory”, I have a couple of slots that should trace “Pres” whenever I click on them. Problem is, it doesn’t. I think it has something to do with my inventory hide/show code because when I took it out, everything worked. Heres the code for the inventory:

//This is so that it stays in one spot when the movie loads.
onClipEvent (load) {
    yMove = _y;
    easeSpeed = 5;
}
onClipEvent (enterFrame) {
    _y += (yMove-_y)/easeSpeed;
}

on (rollOver) {
    _root.inventory.yMove = 96.8
}

on(rollOut) {
    this.yMove = -42
}


Any hints?

i guess you are writing code inside the MC. Congrat, you will have to make 200% extra time editing the code. And you will have about 400% more syntaxes.

onClipEvent = Movieclips only
on = buttons only

But, this could be made in root:
clip.onEnterFrame ()
clip.onPress
clip.rollOver
clip.rollOut

Yes, I put the trace code on the “slot” mc thats inside the inventory MC. But I did that b4 in another project and it worked…both my inventory and slot are all MCs. What should I do?

Anyone? Some help?

have all action script in frame 1.
then you can target the mcs with functions more easly:
target.subtarget.onRollOver etc etc

yes, I tried that already didn’t work either. Although I tried doing onMouseDown + if(mouse hittests target) which is basically the same thing as onPress and THAT worked. Should I keep using that or find a way to make the onPress work?

erm post the fla it can’t be that hard…

if you are running cs3 give up now lol

Ok, heres the .fla and swf:

SWF

http://spamtheweb.com/ul/upload/130608/36782_Untitled-1.php

FLA

http://spamtheweb.com/ul/upload/130608/36830_Untitled-1.fla

If you take out the "My Dad == " on your buttons, you can trace “fianlly” which is what I think you’re looking for, no?

no No no, that was just a accident. I want to make the onPress work instead of hittest+mouseDown. Is there any way to do that?

And here’s a pretty simple inventory of mine:
http://www.n99creations.com/vieweg.php?id=19

Mind if you post the .fla for me? I don’t want to through a whole registration process just to be able to download the file.

I had the same problem.
What I did was giving up on the target.onRollOver = function, and replaced it with a listener inside (yep Macsy, inside :wink: ) the menu_mc (the mc that supposed to show/hide itself) that checked if the mouse was in the area of my menu, and placed the action for the buttons on frame 1 of my script.

tell me if you want to see the code.

Yes, please, post the code but also post some links to KeyListener tutorials, as I really want to learn and not just copy and paste :smiley:

Anyone?

Bump…

wait you want it to trace what??? “finally”?

thats just for testing…I’m gonna switch the trace code to something else once it works.

 
/*
inventory.onRollOver = function() {
 //trace(_root.yMove);
 _root.yMove = 96.8;
};
inventory.onRollOut = function() {
 yMove = -42;
};
*/

you need to engineer the inventory box to move in reference on where the mouse is.

By using rollover commands you turn the entire box into a button, buttons within a button don’t work!!!

for example have code which calculates the area the inventory box is taking up

if mouse is within this area, set yMove =98.8 else yMove =-42

that means no hit tests either.

it looks promising graphics wise

Thank you, I will try that immediately. The graphics for the new game are cominga along great, I’ll post up a demo in no time =).