ActionScript 3.0 :: Dealing With XML And Validation

Dec 7, 2009

I'm making a small memory game that is XML driven (users can upload images into the game). I've come to the point where I need to check if the user has filled out certain nodes or not, and if so; check that the input is valid - int when int is expected and whatnot.

What are the ways to check this, and which is best? So far I've only tried checking if a node is == "" or not, but I imagine there must be better ways. I will include lots of switches for the user which should all be optional. This calls for a neat way to validate it.

View 1 Replies


Similar Posts:


PNG File Validation - Dealing With Untrusted Images?

Mar 9, 2010

I have a Flash web app which displays user submitted PNG files. Files are uploaded to the server via some API prior to being displayed. I'd like to make sure no "bad" files are served to Flash, where "bad" is entirely unspecific. Is there a way to validate PNG files against the PNG specs (this would catch corrupted files)? Or any best pratice on dealing with untrusted image files? I only need to handle PNG, so JPG, GIF etc. support is necessary. Language mostly does not matter, though I'd prefer Python solutions. This is on a Unix webserver.

View 1 Replies

Flex :: Clear Validation On TextInput When Validation Is Not Enabled?

Jul 13, 2009

I've created a custom textInput componenet that handles it's own validation using a private validator. The validation is enabled depending on the state of the component i.e. validation is enable when the components state is "edit".However, when the state changes from edit the internal validator is set to not enabled but the validation errors on the textbox do not clear - the textInput still has the red border and on mouseover the validation errors come up. What I want to happen is that when a validator is disabled the error formatting and error messages clear from the text input control.

Does anyone have any idea how to do this I tried setting the internal validator instance to enabled = false and dispatching a new focusOutEvent as below but the validation error formatting is still applied to the textInput contrl.

_validatorInstance.enabled = false;
//clear the validation errors if any
dispatchEvent(new FocusEvent(FocusEvent.FOCUS_OUT));

[code].....

View 2 Replies

Flex :: Dealing With Namespaces In E4X

Dec 14, 2011

I'm trying to get data from a namespaced xml file in a flex app. There is a root namespace (xmlns="blah") and another namespace (xmlns:i="blah"), and I'm able to access most tags using the following:
var ns:Namespace = doc.namespace();
var result:XMLList = doc.ns::element;

However, there are several tags that are subject to change in the application, and i'd like to not hardcode them, possibly using the elements method:
var result:XMLList = doc.elements(configuredField);
Is there a way to get elements with namespaces using the elements method, or a similar way to get XML elements in flex using a parameter?

View 1 Replies

Flash :: Dealing With Many Objects?

Mar 2, 2012

I am making a strategy game and came across a kind of problem. Basically, I don't know how to deal with the dynamic creation of the units I need. Should I use some big switch statement or is there a more ideal solution?

View 3 Replies

Actionscript 3 :: Air - Library For Dealing With OpenSoundControl?

Aug 14, 2011

I would like to send and receive OpenSoundControl in an AIR application, on the opensoundcontrol.org website I have found existing libraries for many languages, but none for Action Script so far, do you know of one that could be readily used?

View 1 Replies

ActionScript 3.0 :: Dealing With Positioning In FULL_SCREEN?

Apr 23, 2009

I have an app that has a fullscreen button that goes into fullscreen NO_SCALE. Keeps everything looking sharp. However, all of my movieclip positions aren't correct. To fix this, I need to use:

Code:
stage.addEventListener(Event.RESIZE, stageResize);

Then, in my stageResize function, I duplicate all my movieclips' x and y and (if necessary) widths. This seems wrong and cumbersome.

Here's an example of what I'm talking about. Full Screen - Doesn't Work Clicking on fullscreen brings you to fullscreen but the mc positions stay put. Here's the code for this one:

Code:
var btn_fullScreen:btnFullScreen = new btnFullScreen();
var btn_normalScreen:btnNormalScreen = new btnNormalScreen();
var bar_bg:barbg = new barbg();

[Code].....

View 3 Replies

ActionScript 2.0 :: Everything Dealing With SharedObjects In The First Frame ?

Jul 1, 2009

Everything dealing with sharedObjects in the first frame is this:

[AS]
var PlannerData:SharedObject = SharedObject.getLocal("PlannerData");
SubjectChoices = PlannerData.data.subjectChoices;
if (SubjectChoices == undefined) {[code]....

Going to the second frame from the first frame, the data is perfect. Going back to the first frame from the second, I'll trace the data many times throughout the code without an onEnterFrame, and it'll tell me that the Array is good...But when I trace the onEnterFrame, it shows the Array is [undefined, undefined, ...] like..undefined 17 times.

View 1 Replies

Professional :: Dealing With Layers From Duplicated Scenes

Jul 28, 2011

I'm using Flash CS5.5. I had some unfinished work on flash 8 and I'm running actionScript 2.0  In one of my scenes I had come up with a good button set up I wanted to use in all of my scenes. So I duplicated the scene, and proceeded to re-name my layers on the new scene according to the new content in the form of bitmaps. Well, on the output I got warnings such as: "duplicated label on layers". My SWF is still showing normally but I don't know what to do with the warnings. Is there something I should have done other than double clicking directly on the old labels on the layers and chaging their name?

View 1 Replies

Flex :: Dealing With Automatic Adding Scrollbars?

Sep 3, 2010

I'm creating a container and it's content at runtime. Here's a rough structure:

--VBox
----Form
-------FormItem

[Code]...

I've tried also validateNowand other similar methods. What I have here:

1. The HScrollBar is being added.

2. We increase a bit the width of container, so it disappears.

3. When it disappears, the validating throws the null-pointer exception when it tries to measure the non-existing scrollbar. I've also tried to add validateProperties before validation, but it didn't worked either.

View 1 Replies

Actionscript 3 :: Dealing With Sequence Of Functions Linearly?

Jun 25, 2011

I want to have a series of functions that execute one after another instead of one within another.

here's what I mean

[Code]...

View 2 Replies

Actionscript 3 :: Dealing With Display Objects On The Stage?

Oct 3, 2011

I think there are 2 different practices with dealing with display object on the stage.You draw all the objects on the stage and then manipulate the "visible" attribute to show or hide them.You use addChild and removeChild to manipulate the visiblity.How do you think what is the best method for this?

View 3 Replies

Flash - Dealing With A Transparent Png File Symbol?

Oct 5, 2011

In my project, there is a frame(png files) placed on the top of all symbols. After that, I apply mouse click event to the symbols that place underneath the frame symbol, but when I run the the game, I cannot click to the below symbols but only the frame symbol, although the frame is transparent.

The problem is, although the png picture has some transparent area, the mouse click cannot pass through it. Is there solution? Is there anyway I can disable a symbol from being clicked and mouse click event can recognize the symbol placed under it?

View 1 Replies

ActionScript 2.0 :: Dealing With Options In A Program Along All The Scripts?

Mar 19, 2007

How do professional programmers deal with preferences for their application?when there are options to be chosen in an application, does the program is full of "if" to detect what option has been chosen?Let's say that there is a call to 30 functions in the program.But the user has got to choose between an option A or B that would modify the way those 30 functions work.Would you have to write 60 functions and then place an "if" condition each time to go to the needed one...

Or would it be possible to write at run time (after the program has read the preferences) the corresponding functions? So that it wouldn't be necessary to check conditions each time?The goal being to gain total speed in critical functions preventing their run to be slowed down by condition requests.

View 2 Replies

ActionScript 3.0 :: For Loop - Dealing With Associative Array?

Jul 16, 2011

I have an associative array of values called definitionsArray which I use as references to instantiate classes in a run time shared library.I instantiate and push the object into a new array. The problem is when I try to access or do anything basically with that new array.As they are objects they don't seem to like being in a display list for example.

HTML Code:
var definitionsArray:Array;
var bubblesArray:Array;
var currentBubble:*;[code]...

View 11 Replies

Professional :: Dealing With Loop To Part Of Time Line

Dec 21, 2010

I need to adapt it so that instead of looping all the way back to the beginning, it instead goes to points further into the animation (such as say 10 seconds in) rather than all the way back to the start.[code]Now, I'm thinking that what needs to be changed is the autoRewind = true section, but being a complete novice, I don't even know where to begin. I've seen online sections dealing with a goto command, but my attempts to alter the code haven't worked correctly

View 4 Replies

ActionScript 3.0 :: Masks Dont Function When Dealing With 3d (properties)?

Dec 29, 2010

I can find in the Adobe's help that masks dont function when dealing with 3d (properties). In this case I stuck on big obstacle in my project,where I wanted to deal with masks, and .z property. I wanted to tween mainMovieClip via TweenLite to make it going away from view.mainMovieClip has mask inside it ( added by the code), and certainly after tween is done mask is unaplied anymore, what is more disgusting functionality for eventListeners (clicks) attached to movieClips behind the mask gone far away. So in the end mask does not work, and everything behind it doesnt too..I need some specialist if my approach to the problem could be somehow a solution. I tried by it doesnt seem to work:I thought that if before tween I would disable the mask, by just setting

mainMovieClip.someMaskHolderMc.mask = null; 
and then after tween is done, I could re-set it:
mainMovieClip.someMaskHolderMc.mask = someMasker;
 
but I end with nothing though, apart of that after tweening I can click once of the areas I had eventListeners before the tween, and then
all functionality disappear. Masks do not work too .

View 2 Replies

ActionScript 3.0 :: Way Of Dealing With 'implicit Coercion' Of Array To Sprite?

Apr 18, 2011

With continued help from this forum I am getting closer to having a working program. I look forward to being able to help others like myself once I finish learning the AS3 ropes.I have created a 12 x 9 random number grid that populates each cell with a corresponding image based on each cell's numeric value. I have also created a shuffle button that randomizes the numbers in the grid. The problem I am running into is getting my button-click event to clear the current images off the grid in order to assign new ones (i.e. deleting the display stack objects in order to place news ones in the same locations).My question is this: what is the best way to handle an implicit coercion from an array to a sprite? I have pasted my entire code below so that you can see how the functions are supposed to work together. My trouble apparently lies with not being able to use an array value with a sprite (the sprite represents the actual arrangement of the grid on the display stack while the array starts out as a number than gets assigned an image which should be passed to the sprite).

View 10 Replies

ActionScript 3.0 :: Dealing With An IOError (Errors 2044, 2032)?

Aug 5, 2010

I'm trying to deal with an error that happens when an XML files is "loaded" that doesn't exist.Line that causes the error:

Code:
loader.load(new URLRequest(url));

I've tried putting a try catch(e:Error) around it, I'm tried an event listener for IOErrorEvent:IOError, but I can't seem to deal with the error.

Error message:Quote: Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: [File Name] at blah blah.....

View 4 Replies

ActionScript 3.0 :: ''if" Statements When Dealing With A Stream Of Sensor Data?

Apr 17, 2010

After a not inconsiderable effort I've managed to get a touch sensor attached to a microprocessor talking to flash. It gives a constant analog input giving a value between 0 and around 300. When it reads 0, the sensor is being pushed hard enough, and my aim is to get an object to appear on the screen every time the sensor is pressed so that it reads 0.[code]Which works, when the sensor reads 0 it traces "zero", except it does it every time it reads the sensor, so there's huge great list of "zero"s generated.What i want is for it to trace "zero" only the first time it detects a zero, and not do it again until the value rises past zero and back down again.Is there a conditional way to do this? Something like "If previous value was greater than zero and this value is equal to zero, trace zero. if not, do nothing"?

View 2 Replies

Actionscript 3 :: Parsing A Large CSV File, Dealing With Commas And Quotes

Oct 12, 2010

I need to load in a large CSV file (>1MB) and parse it. Generally this is quite easy to do by splitting first on linebreaks and then commas. The problem is though that some entries contain Strings that include their own commas. When this spreadsheet is converted to CSV, the lines containing commas are wrapped in quotes.

I've written a parser that first escapes all the commas in these strings, then splits it on linebreaks and then commas, and then unescapes the values again.

This is quite a slow process for such a long string, as I need to iterate through the whole string. Does anyone know a faster or more optimised method of dealing with this?

View 3 Replies

ActionScript 3.0 :: Flash Dealing With Parents / Children And Setting Things To Null

Jul 12, 2010

Seeing as I don't have too much formal education Flash/OOP in general, this is just one of those thing I can't seem to quite deal with gracefully. All I'm trying to do is to be able to load/reset my an instance of my game's main class (not the first class that gets pulled up by Flash, but the one that actually has games logic in it), which of course extends MovieClip. It took me a while before I could even make an instance in it, because it would silently crashed when I would try to do so, and what didn't help was that the output window stopped working, and I had to completely reinstall flash. As far as I remember I simply fixed it by taking out the "stage." from any of the lines of codes that had it.

[Code]...

View 6 Replies

ActionScript 3.0 :: Validation On App Startup

Mar 1, 2010

I've created a form based flex app that populates some fields on startup. I'd like to validate that several text fields/labels are not null on startup. If any required fields are null I"ll throw and alert and close the app. There are only 4-5 fields that I need to check.

View 5 Replies

Forms Validation Or Check Up?

Nov 22, 2009

I am doing some forms in Flash Cs4 with AS3. The forms are working well, but i have a code to check if people have enter information in every field. But the verification only works for 2 field. The code is exactly the same for the other but it doesn't work. Can you double check my code and maybe explain me why it doesn't work or maybe how to replace the validation code by another.

[Code]...

View 1 Replies

ActionScript 3.0 :: URL Validation Without Using RegExp?

Feb 4, 2011

I am using URL Loader to hit the server (e.g. Yahoo server) and then listing to HTTPStatusEvent.HTTP_STATUS" listener for Status code 200. If the response code is 200 then form submits to database else I am giving the error "URL is not valid".I am running my application from Tomcat server using address Issue: On submiting the form Flash returns "SecurityError stating "form.swf" cannot access data on "Yahoo server".I have also placed a crossdomain.xml file on the server with allowDomain set to wildcard "*";

View 3 Replies

IDE :: Zipcode Character Validation?

Jul 21, 2009

On the stage:Textfield called "inputTXT".And a button called "Go". All I am trying to accomplish here is to have the input characters validated to be ONLY numbers and max 5. However, I don't want to use:"inputTXT.restrict = "0123456789".

Instead I would like to check if the characters entered after pressing the "go" btn, are within the defined parameters above (numbers and max5). If yes, then I need to pass a URL, if not then I need to display an error message.

View 1 Replies

ActionScript 2.0 :: Validation For Input Box?

Jun 10, 2010

I have tried to make validation code for an input box (flash 8) however I cant seem to get it to work, heres the code i have

allow = new Array(" ","a","b","c","d","e","f","g","h","i","j","k","l", "m","n","o","p","q","r","s","t","u","v","w","x","y ","z"," ","A","B","C","D","E","F","G","H","I","J","K","L", "M","N","O","P","Q","R","S","T","U","V","W","X","Y ","Z");
function validate(user_name){

[code]....

The basic gist is that it runs throught the input box and checks if the letters are in the array,and if they are it adds 1 to temp2 then at the end it checks how many characters are in the input box, and if they equal == temp2 then it goes to the next scene, else it says "Please....etc" The PROBLEM is that if the user types in a letter twice, such as " HELLO" then the code only counts 1 L instead of 2 L's. so then it throws out the sum because it wont be correct.

View 2 Replies

Actionscript 3 :: Validation And Invalidation In Flex

Jun 23, 2010

I am new in flex and recently read about Validation and Invalidation in components.

View 2 Replies

Flex :: Username And Password Validation?

Feb 23, 2011

i have a problem while username and password validation.i retrieved data (username and password)from an xml doc using http service but the problem is that i have to verify the username and password entered by he user with the username and password of the xml doc...

my xml doc is as follows:

<employees>
<employee>[code]....

View 1 Replies

Php :: Client-side Validation For Uploadify?

Jun 9, 2011

I am working on a page which uses uploadify to upload several images. The requires the user to upload these files. Is there a way to validate these field(s) on the client-side, such as with jQuery or JavaScript, prior to submission? I am comfortable with doing the server-side validation, such as with PHP.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved