Solved

How to add hotspot buttons within a draggable movieclip?

Posted on 2010-09-16
6
334 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 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

13 Experts available now in Live!

Get 1:1 Help Now