1
votes

I am new to createJS toolkit (Flash CS6), My concept is I have a multiple buttons on the stage, each button click will have different animations in different frames.

my code is

'/* js 
this.stop();
this.btnname.onPress = function()
{ this.parent.gotoAndPlay("cone"); }
*/'

it is perfectly working in all browsers and android mobile, but in iPhone it is not working, I am trying to click on the button but canvas is highlighting in iphone, when I change my code to the following code,

'/* js 
this.stop();
this.onPress = function()
{ this.gotoAndPlay("cone"); }
*/'

It is working in iPhone, but I have multiple button clicks, here is my major problem.

Please help me find a solution to this issue.

2
could you tell me whether you were using Shape class for your buttons? - Dmitry Koroliov

2 Answers

0
votes

Use addEventListener and listen for the "click" or "mousedown" event instead of assigning an onPress function. Like this:

/* js
this.stop();
this.btnname.addEventListener("click", function(){
    this.parent.gotoAndPlay("cone");
});
*/
0
votes

You need to create a shape, cache it and use it as the hitArea of your button. john has answered your question here: http://community.createjs.com/discussions/easeljs/5663-touch-on-ios-only-seems-to-work-with-bitmaps