Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-27-2012, 11:44 PM   #1
JeremiahLight
Registered User
 
Join Date: Apr 2012
Posts: 23
Default User Interaction With Dynamic Text Fields

Hello Everyone,

This is my first post here. I am working on a simple math game, where the player will be given a series of numbers and three possible answers(the total of all the numbers). The player will drag the selected answer into the "slot" so to speak.

My question is, what would be the best way to handle the numbers. For the main numbers(the ones that will be added together) I am just using dynamic text fields, which display random numbers. I initially was going to follow this same method for the answers as well. But, the answers need to have drag and drop functionality. And, being a dynamic text field, I though there may be some issues.

For example, dynamic text often conflicts with a button, making the mouse cursor flicker and such. My idea is to design little tile graphics which the numbers sit on top of. With the numbers that will be added together, there really is no issue, as there is no user interaction. But, the answer tile will be moved around.

Is there a way to avoid the cursor issue with dynamic text? Or, would there be a different way to display random numbers without using a dynamic text field?

I am currently compiling the random numbers like so:

var numOne:Number = Math.floor(Math.random() * 10 + 1);

This gives me a random number between 1 and 10 and is repeated for each number needed.

I then total these numbers by simply creating another variable:

var total:Number = numOne + numTwo . . . ;

From there, I have dynamic text fields on the stage to display the numbers above.

firstNum.text = String (numOne); and so on.

This all works fine for the numbers that will not involve any interaction. But, I foresee issues using a dynamic text field meant to be dragged and dropped.

So, what I want is a randomly generated number that can be dragged and dropped, while avoiding the cursor flicker produced by a dynamic text field. Any insight would be much appreciated.

JL
JeremiahLight is offline   Reply With Quote
Old 04-27-2012, 11:49 PM   #2
abeall
Senior Member
 
Join Date: Feb 2006
Location: Washington, DC
Posts: 2,812
Send a message via AIM to abeall
Default

Try setting the TextField/selectable to false -- this will mean the text is not selectable and might fix the cursor issue you were seeing.
__________________
Aaron Beall | Flash portfolio | Fireworks extensions | Twitter
abeall is offline   Reply With Quote
Old 04-27-2012, 11:59 PM   #3
JeremiahLight
Registered User
 
Join Date: Apr 2012
Posts: 23
Default

Thanks . .worked like a charm. Half the battle is learning all the properties available for manipulation. Thanks again.
JeremiahLight is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:09 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.