Topic: Changing Button Position

Felix,

I'm trying to place my buttons *beneath* my images in AV. 

In 'stagemanager.as' I changed the following (for example):

mBackBtn.setBtnPosn(680,534);
mBackBtn.setHitSize(Math.round(w/2),Math.round(h/3*2));
mBackBtn.setHitPosn(680,534);

to absolute values:

mBackBtn.setBtnPosn(680,534);
mBackBtn.setHitSize(Math.round(w/2),Math.round(h/3*2));
mBackBtn.setHitPosn(680,534);

And it works great except now the buttons won't accept hits!

What am I missing?  Please help!



Ken

Re: Changing Button Position

Hey Ken,

The hit area is determined by the middle line in the code examples you included below.  The code samples you posted are exactly the same so I'm not sure exactly what you've changed, but it's likely that you changed the button location without modifying the hit area.  The hit area is what determines where users can click to initiate an image change.

I don't have the code in front of me but I'm guessing it's setHitSize(x,y) so you probably need to modify the second parameter so that it includes the area underneath the image where you have placed the buttons.

Hope this helps! 

Brian

Re: Changing Button Position

I don't have the code in front of me but I'm guessing it's setHitSize(x,y)

I already guessed as much, but changing it to absolute values isn't working for me.

Additionally, AV's hit areas are currently a good deal larger than the actual buttons.  I will need to confine my hit areas to the actual button dimensions.


Ken

Re: Changing Button Position

I'll check the code tomorrow but there is a slightly confusing relationship between the image and stage width and height and the positioning of the elements. 

See if any of these setups work for you, I'd be happy to send you the source code and modified configuration files if you think it would be helpful.  Be forewarned though that I didn't intend for this to be distributed so it's quite messy.  The hit areas are not confined to the buttons but I don't think ("think" being the operative word) that it should be that hard.

http://brianchapmanphotography.com/?p=22

Brian

Re: Changing Button Position

I'll check the code tomorrow but there is a slightly confusing relationship between the image and stage width and height and the positioning of the elements.

I'll say.

Your 'all sizes' layout is pretty close to what I want to do, I'd *love* to see the .as for that.  If I could shrink the hit areas for the arrows it'd be perfecto.

Btw, Seattle is one of my favorite places on the planet.  Your pictures are excellent.

www.kenluallen.com
(This is the website soon to be replaced.)

Ken

Re: Changing Button Position

Hey Ken,

I sent you the stuff and an attempt at an explanation to what I've done...I hope it helps!

Brian

Re: Changing Button Position

*Bump* for Felix.

I actually think the easiest thing might be to use buttons in my main movie to control AV.

How can I correctly target AV's showNext(); and showPrev(); with the actionscript on my main timeline?



Ken

Re: Changing Button Position

import com.airtightinteractive.apps.viewers.autoViewer.StageManager;
var sm = StageManager.getInstance()
sm.showNext();
Felix Turner
SimpleViewer Support Team.