Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Button behaviors

Posted on 2011-03-02
4
Medium Priority
?
329 Views
Last Modified: 2013-12-24
I'm using Director 11.5 and am trying to add one of the pre-built buttons to my stage. I've never used a button before, but I've added it to my frame which has...

on exitFrame me
  go to the frame
end

Open in new window


...attached to it.

I've selected the button sprite, and then clicked on behaviors and added a new (internal score behavior) script that has an on MouseUp event. Bassically the script is as follows;

on mouseUp me
  go to next
end

Open in new window


However the button doesn't do anything. The event doesn't seem to fire.

I wonder if somebody could show me where I am going wrong please?

Thanks,
LLMorrisson,
0
Comment
Question by:LLMorrisson
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
ute_arbeit earned 2000 total points
ID: 35023341
If the button is a Flash component button the traditional mouseUp, mouseDown etc .events are not fired. Instead a click event is fired when it is enabled. To enable the click event set it to true in the Flash component tab in the property inspector when the button is selected.

Then your handler would be:
on click me
  go to next
end 

Open in new window

0
 
LVL 5

Author Comment

by:LLMorrisson
ID: 35035707
Ahh I see. Great. Ok so I changed my handler code to the above, and it does work, but it seems a little glitchy. It doesn't seem to fire on the first click necessarily. I have to click it a two or three times. Is there any reason why this might be? Is there a better way to code it so its more robust?

Thanks,
LLMorrisson.
0
 
LVL 4

Assisted Solution

by:ute_arbeit
ute_arbeit earned 2000 total points
ID: 35035874
I personally do think the Flash components are a little glitchy by nature. I prefer using the old style controls. You can switch the tool bar to show the "classical" components instead of the flash components.
Of course you have to revert to mouseUp again then.
0
 
LVL 5

Author Comment

by:LLMorrisson
ID: 35035973
I agree, the classic button seems to work much more reliably. Thanks for the help.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
Suggested Courses

971 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