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


Similar Posts:


ActionScript 3.0 :: Program That Queries A Database For Options And Displays The Options In A Number Of ComboBoxes?

Aug 29, 2011

Im building a program that queries a database for options and displays the options in a number of comboBoxes. The comboBoxes are dynamically built and loaded via code and added to the stage. I would like to build the comboBoxes into a single movie clip (maybe not the correct wording) so I can use options like tweening and such to make it look better. The code is below.

package classFiles
{
import flash.display.MovieClip;

[code]....

View 3 Replies

ActionScript 3.0 :: Add An Exit Button Onto Program So When Its Clicked It Exits The Program Completely

Nov 4, 2008

Im trying to add an exit button onto my program so when its clicked it exits the program completely.. I've tried some of the suggestions on the forums but they arnt working. what I have been using and its not working..

// CLICK to Exit
exit_Btn.addEventListener("mouseUp", goExit);
function goExit(evt:MouseEvent) {
fscommand("quit");
};

View 9 Replies

ActionScript 2.0 :: Start An Unrelated Program (such As Window's Media Player) From Inside Of A Flash Program?

Sep 29, 2010

Is there a way to start an unrelated program (such as Window's media player) from inside of a flash program?

View 2 Replies

ActionScript 2.0 :: Program A Timer For A Typing Tutorial Program?

Mar 24, 2003

I need to program a timer for a typing tutorial program. It needs to go to 5 minutes. When the timer gets to 5 minutes the movie has to go to frame 13 which displays the results of the typing test.

View 1 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.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

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

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 :: 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 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 :: Connection From Program To The Server Using XAMPP Server And Program In Flex?

Oct 26, 2010

i have the following code ]

[Code]...

but no connection established what is the reason behind not know help required and one more thing XAMPP is installed in D: drive.

View 1 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

Flash8 : Run A Flash Program From Another Flash Program?

Jan 29, 2010

I have created a flash program and I would like to run a second flash program from inside the first. To explain, say I am running a program that draws a circle and fills it with a color. Then, I have designed a second program that will divide a circle into sectors by entering percentages, to turn that circle into a pie chart. Is there a way to be running the "draw a circle" program and have a button that opens the "divide the circle into sectors" program in a new window and then passes information from that program to the first program. I am sure I will have to send the information from the second program to an XML file and then have the first program recieve it from the XML file (which I can do), but I don't know if I can run the second program from inside the first program.

View 1 Replies

IDE :: Mpg To Flv - No Audio Options

Dec 14, 2007

i'm trying to convert mpg videos to flv videos. i'm using adobe cs3 flv converter as well as quicktime pro. both yield a flv with no audio.

i open the video in quicktime pro. it plays with sound. then i go up to FILE > EXPORT > MOVIE TO FLASH VIDEO (FLV) click on OPTIONS then click on AUDIO. it's all grey. no audio options.

i am aware of this problem/solution regarding flv's stopping short but i'm not even get audio options. "It has everything to do with sound sample rate! You need to export your movies that are currently using 22.050 kHz and to a new quicktime movie with a 44.100 kHz sample rate. THEN export as a .flv with whatever frame rate and .mp3 compression rate you need. This should fix the problem!"

View 3 Replies

Check Buttons With Two Options?

Jan 7, 2010

i want to make a check button where you can put a tick or a cross in the box. is this possible?

View 3 Replies

ActionScript 3.0 :: Options For Reducing Lag?

Nov 13, 2009

I have a game were there are a lot of little guys moving around on the screen independently of each other and I have a function for zooming in and zooming out. I want the guys to look good when I zoom in but not lag when I zoom out and show a lot of them. What I'm thinking of doing is just making different levels of detail that it uses for the guys at different zoom distances.I don't know what makes vector graphics lag. Is it the number of shapes it has to redraw every time something moves? Or is it just determined by the number of objects on the screen at a time regardless of detail? I want to know if it would make a big difference in lag before I go redraw everything because it would be a big task and I don't want it to be for nothing.

View 1 Replies







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