Solved

How to add hotspot buttons within a draggable movieclip?

Posted on 2010-09-16
6
336 Views
Last Modified: 2012-05-10
How is this done (link below)? I've been able to create a draggable 3D object in flash but I can't seem to add a hotspot within the main movieclip because the parent object is blocking the button.

It's done here and I really like the way it works:

http://www.expeditiontitanic.com/#/explore/deeper-look/spin/rov

Any ideas?
0
Comment
Question by:pixystk
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:bupper
ID: 33697872
Have one parent movieclip. Within it, have child1 (which registers the dragging code and contains the image, background, etc.) and another child2 (which contains the buttons). When the user clicks and drags child1, it should not drag child1, but rather the parent - in effect, dragging both child1 and child2. You can specify rotation, scale, position, etc. on the parent.

Make sure child2, the buttons, is above child1!
0
 

Author Comment

by:pixystk
ID: 33729548
Thanks bupper, I have the movie working inside the contaner movieclip. So you're saying to add the buttons to a separate movieclip?

but if i need to only show the hotspot on a select few frames while it's being dragged. do i add the button/movieclip inside child1???

confused.
0
 
LVL 5

Expert Comment

by:bupper
ID: 33729650
Yes - child1 and child2 should both be separate MovieClips.

Put the object (pictures, background, etc.) in child1.

Put the buttons in child2.

When you drag, just drag the container clip, and _not_ child1. For example, add the following code to child1, in the first frame (any layer):
[Using AS2]
this.onPress = function () {
    startDrag(_parent, .................); // ADD THE REST OF THE PARAMETERS
}

Why do you ever need to "show" the hotspots? A Hotspot is just the area someone can click on a button. So if you have text, but you want a larger area to be "clickable", then you make a rectangle in Frame 4 in the button on the stage.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:pixystk
ID: 33730410
sorry for the confusion... what i mean by hotspots are the actual buttons. In some of the 3D VR applications that's how they refer to the buttons. These buttons correspond to a series of frames in the rotation... the button is tweened to follow a specific point. (button_mc)

I'm posting my flie so you have a look...(teapot.txt -- .fla named as .txt)I want the buttons(movieclips) to load a movieclip to the stage when you mouseover it and disappear when you mouseout.


teapot.txt
0
 
LVL 5

Accepted Solution

by:
bupper earned 500 total points
ID: 33730605
Ok, I took a look at the file and fixed it for you. I attached the fixed version as you did -- .fla named .txt.

What did I all do? Take a look yourself -- I nested the clips, somewhat how I described previously; I also fixed some of your code so the popup would appear (the name was wrong), etc.

Hope this works for you! :)
teapot-fixed.txt
0
 

Author Closing Comment

by:pixystk
ID: 33736705
yes! perfect!!
Thank you so much!!!

I modified this a bit to change to a rollover/rollout, but it works and i'm very very very happy!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now