Solved

how can we use Validations in Flash ?

Posted on 2009-04-15
3
215 Views
Last Modified: 2012-08-13
http://www.dotcompreview.com/kite.ie/custome_design.asp

I wants to put validations in include shorts, socks, sleeve length etc..
i wants to put validations in radio buttons and its custom made not from default flash library.

please find the attach jpg ( screen shot of above link )
Kite-ie---MENS---DESIGN-PAGE.jpg
0
Comment
Question by:dotsandcoms
  • 2
3 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 24191444
not sure what you're refering to by validations, are you wanting to check that a radio button is selected for example?
0
 

Author Comment

by:dotsandcoms
ID: 24191610
yes... by default all radio buttons are not checked. if any one forget to select i want to notify them that you have to select yes / no . and this radio button is not from Flash Components, its custom created.

just tell me if you want anything else....
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 24202982
ok i'm not sure how you've created your radio button.
but assume you have a button that you want to submit information but it needs to do validations first.

so what you can do is create a function to handle all your validations.

you didn't mention what version of AS you're using the following example is based on AS2 but it explains the logic. It also assumes your radio button has 2 frames for selected or not selected. did you build your radio buttons as components or just normal movie clips? if the latter you'll need to check each one individually as you aren't using radiogroups. so assume you have rd1 and rd2 as radiobuttons and first frame is not selected.

function validateSelections():Boolean {
if (rd1._currentFrame ==1 && rd2._currentFrame == 1 )
{
return false;
} else {
return true;
}
}

then on your button.

submit btn.onRelease = function () {
if (validateSelections) {
//they selected something carry on;
} else {
//none of the buttons were selected so notify accordingly.
}
}

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now