Solved

Button behaviors

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
The purpose of this video is to demonstrate how to Import and export files in WordPress. 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 : Click on Too…
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…

752 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