Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to add hotspot buttons within a draggable movieclip?

Posted on 2010-09-16
6
Medium Priority
?
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 

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 2000 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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

618 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