Skip to main content
Known Participant
October 20, 2011
Question

iOS and AS3

  • October 20, 2011
  • 1 reply
  • 1639 views

I have some problems while creating an app for iOS with Flash CS5.5 and AS3...
It gets crazy while selecting input text!!! The text change font and become very big, then when i deselect it it became 10-15 px bigger.... i am not able to import multitouch gestures... tried a lot of solution but nothing works... problems with TEXTNAME.restrict... it doesn't restrict anything...

EDIT: Finally imported multitouch, but i cannot use a swipe to do operations with a Number... shake my head

This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
October 20, 2011

Lots of questions in that one message!

The easiest solution to the large text is to use device fonts. Try using _sans.

multitouch and gestures are opposites of each other. You have to say which of the two you're using. If you want the user to pick up two items on the screen and bring them towards each other, that would be multitouch. If you want to know that the user is trying to shrink the image, that would be a gesture. Both of those would be the same physical action by the user.

You could remain in multitouch, and use your own logic to figure out that the user is trying to do a swipe. Or, if you go into a screen that needs multitouch, have a way to get out of that screen that doesn't require a swipe.

Known Participant
October 20, 2011

Pratically I Have a Button and when the user does a swipe to the right, the value became value + 1, when the user does a swipe to the left, the value become a value -1

Code

import flash.events.GestureEvent;

var ScoreHome:Number = 0;

HomeScore.text = ScoreFormatHome(ScoreHome);

ButtonplusHome.addEventListener(TransformGestureEvent.GESTURE_SWIPE, fl_Swipe);

function fl_Swipe(e:TransformGestureEvent):void

{

     if (e.offsetX == 1) {

         ScoreHome++;

     HomeScore.text = ScoreFormatHome(ScoreHome);

     }

     if (e.offsetX ==-1) {

         ScoreHome--;

         HomeScore.text = ScoreFormatHome(ScoreHome);

    

     }

}

Known Participant
October 21, 2011

Now the big text is my priority.
When (on iOS) i try to edit the text it becomes very big... when i stop editing it it becomes of regular size... i am using Classic Input TextField

If i try to reduce the size in as3 never changes, it becomes the same big size when editing...