Solved

How to add hotspot buttons within a draggable movieclip?

Posted on 2010-09-16
6
335 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

914 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

12 Experts available now in Live!

Get 1:1 Help Now