Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8773151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:13:17+00:00 2026-06-13T18:13:17+00:00

Hi everyone I’m new in both languages… I found a example for scrambled numbers

  • 0

Hi everyone I’m new in both languages… I found a example for scrambled numbers in JavaScript and HTML I would like to convert that code into ActionScript code, the languages looks similar for me but when I compile it in Flash Builder nothing happens… I would like to understand how to do the example but in ActionScript and MXML code…

JavaScript code parts that I don’t understand how to do it in ActionScript:

function check(value)
{
    if ( value != Math.round(value) )
   alert("You must enter an integer in this input box.");
}
function generate( )
{
var minval = parseInt(**document.form.min.value**);
    if ( isNaN(minval) || minval != parseFloat(**document.form.min.value**))

And To implement this with TextInput in HTML:

<INPUT TYPE="text" NAME="**min**" VALUE="" ONCHANGE="check(**this.value**)">

I don’t know hot to leave it in AS3 and MXML…
I tried:

public function generate()
{
var minval = parseInt(**min**);
if ( isNaN(minval) || minval != parseFloat(**min**))
{

and the MXML:

<s:TextInput id="**min**" change="**check(this)**" />

As you can see I’m very lost…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:13:19+00:00Added an answer on June 13, 2026 at 6:13 pm
    <fx:Script>
    

    <![CDATA[

    import flash.events.Event;
    import mx.controls.Alert;
    public function check(event:Event):void
    {               
            if (isNaN(parseInt(min.text)) || isNaN(parseFloat(min.text))) {
                /* Do something here*/
                Alert.show("Input a number", "Error");
            }               
    }
    ]]>
    </fx:Script>
    <s:TextInput id="min" change="check(event)"/>
    

    This code works the way you want I guess.
    Please bear something in mind that the parseInt function ignores any trailing non numeric characters after a valid integer. Say for example, the code works if you enter “a” first, but fails if u enter 1a. More details about the function can be found here

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/package.html#parseInt()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

everyone. Please see example below. I'd like to supply a string to 'schedule_action' method
everyone.I wanna include javascript in the html(webpy templates),but it doesn't work.the javascript code in
everyone. I have a string like this String message = This is the new
everyone, I would like to connect my galaxy nexus to the eclipse, which allows
Everyone, every blog is talking about HTML 5 and giving solution to use HTML
everyone! new to here and been pondering about this myself for some times with
Everyone at Class too big and hard to add new features is completely unphased
Everyone knows? about avatar url in tumblr api / read / json? like for
Everyone likes to talk about reusability. Where I work, whenever some new idea is
everyone I got a question , I want to implement a UI , Like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.