Solved

Button behaviors

Posted on 2011-03-02
4
321 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 500 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 500 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

912 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

23 Experts available now in Live!

Get 1:1 Help Now