Solved

Button behaviors

Posted on 2011-03-02
4
325 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
[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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

630 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