ActionScript 3.0 :: Change The Name Of The Variables While The Program Is Running?
Oct 19, 2010
I have this code:
ActionScript Code:
for (var j:int = 0; j < 20; j++){
if (values==j){
var "ingredient"+j:"Ingredient"+j = new "Ingredient"+j();
[Code].....
it doesn't work for what are probably obvious reasons but I show it to give you an idea of what I'm trying to do which is change the name of the variables while the program is running.
Determine, whether a defined program is running (for example firefox.exe) If its running, then get the current dimensions of its window - i want to make a screenshot of the window, so i'd need other parameters too i guess: Is it minimized? is it behind some other window?
Is this possible to accomplish in AIR? Im using the latest version (2.6)
Ever since I installed Flash CS4 on my computer, it runs fine for a while before becoming really slow to respond and a pain to use, so I have gone back to using Flash 8 which runs fine. Is this a problem with my computer or the program?
I use Flash to develop a movie that runs when a user installs a new version of my companies software, and allows the user to access the user documentation and software installations at the click of a button. I use ActionScript to control the flow of the movie based on radio buttons that the user selects so that they are only provided with information relevant to them.I have been asked if Flash can determine whether a program is installed on the user's computer which can then be used to determine the flow of the movie.
I use Flash to develop a movie that runs when a user installs a new version of my companies software, and allows the user to access the user documentation and software installations at the click of a button. I use ActionScript to control the flow of the movie based on radio buttons that the user selects so that they are only provided with information relevant to them.
I have been asked if Flash can determine whether a program is installed on the user's computer which can then be used to determine the flow of the movie.
I would like to be able to operate a scanner from my AIR application. Since there's no support for this natively, I'm trying to use the NativeProcess class to start a jar file that can run the scanner. The Java code is using the JTwain library to operate the scanner. The Java application runs fine by itself, and the AIR application can start and communicate with the Java application. The problem seems to be that any time I attempt to use a function from JTwain (which relies on the JTwain.dll), the application dies IF AIR STARTED IT.[code]
I have found little to no flash to C++ documentation, let alone Flash to C++ over the internet. What I want to do: -Have flash send a string (or number) from a website to a server running a C++ program -The C++ program will receive the data and do something with it -After that, the C++ program would send back a response -Flash would then accept the response My goal is to make a simple MMO, but I can't start it without a server program to handle the players. I don't need a super-complicated example, just something simple, kinda secure and coded in AS3 and C++.
I'm currently working on a few small paint programs designed to emulate certain famous painters. I'm using a pretty basic AS2 painting program and simply manipulating it to my needs, but have run into a few problems that trial and error have not been able to fix.For two of the programs I would like the up and down arrows of the keyboard to change the size of the brush, which is currently set by the variable ranWidth (one of the other programs uses random widths for the brush).For one of the programs, the left and right arrows will increase or decrease the paint opacity.One of the programs will be a pointillism style drawing program, so instead of drawing a line as it does currently, I'm trying to have it draw a series of dots, without having to click down every time.Third, my color selection right now changes randomly each time the user clicks down. This works fine for some of the programs, but others it really is neccesary to choose a color. I've tried creating buttons with on release functions that would change the color variable but havn't got them to work properly.I know its a bit of a list but I think most of the coding is fairly simple, I'm just new to actionscript and trying to learn the ropes. I've used keys to change items before but am not having any luck.Here is my basic script for one of the painting programs. This one simply draws lines in different colors at random sizes.[code]
I am trying to add an init() function to a MovieClip, but when I run the function from scene1 the variables that were set in the MovieClip are not defined yet... The MovieClip was dragged to the stage from the library.scene1:
I have a flex application that's compiled with flex 4.1.I want that flex application to load an swf that contains the variable score and i want to be able to modify this variable.I wrote two versions of swf, one compiled with as2 code and the other with as3. this is my flex application:
Right now I create a paint program, which will consist of _xmouse, _ymouse, different colors to draw lines, different sizes. But I have a problem: _root.line.lineStyle(size,0x00ff99,100); The size is the thickness of the pen. But it don't seems to work inside of that script.
I can't change property Color of the component Movie Clip in my program? Compiler didn't found the error but when my program run color Movie Clip doesn't change.
I have a bunch of thumbnails i'm getting from XML that have this code on them...
Code: for (e = 0; e < total; e++) { _root.web_thumbs.thumb_button.duplicateMovieClip("button" + e, e + 12); _root.web_thumbs["button" + e].c = e;[code].....]);
It loads the XML variable fullimg into an empty movie clip on its own layer in the timeline.The movieclip, "container", is assigned this code, but the code isn't on the movieclip, it's on a frame designated for just actionscript.This is the code
The Problem Is...When there is no image loaded into the movie clip, it works fine, and shifts around depending on the location of the other movie clip, "content". But, once there is an image loaded into "container", it stops shifting around depending on the location of "content", and just sits in its last location.The only thing i can IMAGINE being problematic is, on another frame, where I have the XML being cut up and assigned to variables, at the end I have a remove _root.onEnterFrame, removing the onEnterFrame at the beginning of the XML to variables line of code, so that is stops running.
Im creating MMO with flash but making it small at first.... I need to know the best way to code the characters.... I was thinking keeping all the data such as coordinates, inventory and cash all in MYSQL so the clients cant change the values in my flash client program. I was thinking of calling quires every few seconds which would eventually becomes thousands... what do you think is the best way about it?
BTW: Flash = Client Side PHP = Server MYSQL = DATA
I am currently trying to port a game that I wrote in as2 to use as3. Most of my code is divided into classes but my art and buttons are placed on the time line and divided into different scenes.Now getting access to these objects are no problem. I just wait for a render event and then I get their reference by using getChild from the root object. Now my problem is that when I change scenes the game suddenly speeds up and run really fast for some time and then goes back to normal.My first experience with this problem was when I added a skip button to my game intro.since I didn't stop it but simply chanced scene it went on playing in the "background" as I could still hear the sounds from it. now when I entered the new scene every animation ran twice as fast or even faster and it stopped once my intro finished in the "background" or wherever it was . I solved the problem by simply stopping all animations before changing scene and thought that was the solution, but I soon discovered that, that didn't work at some places.
When I had made the menu scene working and started moving between some other scenes without animations but with lots of movie clips the problem reappeared. I tried to track my problem down to some move clips and I sort of did find some that I could remove to solve my problem but these clips only contained one frame and had text in em so there was no animations to stop. Also the speedup got pretty random, sometimes I got lucky and the speedup didn't happen but most of the times they did.Now my question is why are these speedups happening, and how do I prevent them?I have been thought about copying everything on each scene into a movieclip and then add and remove those clips to stage, and when I change scenes.
I am working on a try-out app targeting ios and adroid mobile devices and I use flex 4.6. I want to hide the app in the list of running applications. Is it possible?
If not, is there a way to change the name and icon of the app in run-time after installation?
Could anyone please tell me how I can change the number of milliseconds at which a setInterval function repeats, whilst the movie is running? I am using setInterval to call a function which duplicates a movieclip and I need the duplication to happen over decreasing amounts of time. The problem seems to be that the setInterval function only needs to be set once, so declaring it again with a new interval value isn't an option.
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"); };
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.
I want to know is there anyway to invisible title bar for a AS3 project? and how to force program to use fix resolution and change monitor resolution to what we want?
I have a strange problem. When I run an exe projector that I exported from flash cs5.5, and on few of my client's computers it running very slow in full screen.When I running an swf file (not exe projector), also in full screen, it running well!I checked my clients computer hardware, and it match the system requirements of flash player.
I have a problem in Flash Site uploading.That is, i have created a flash site & in the dreamweaver i inserted the flash site as insert -> media -> Shockwave.The site is running inside the dreamweaver but when i publish it, flashsite is not running.
I'm new to AS3 and programming in general and thought I could find some help here. I've tried researching and fixing this problem myself but I can't seem to figure it out.
I'm essentially making a version of Pong as a small project to get myself into programming using AS3. My problem is I've got the ball moving left towards the edge of the stage but I can't make it come back once it reaches the border.
I've an idea of what needs to be done, I need to make a function that sends the ball off to the side of the screen then have an if statement that detects when the ball reaches the border that then tells the ball to stop moving in that direction and move to the other side of the screen. [code]...
In my previous topic whitelynx_nivla gave me a code, which I edited. I'm using it to set variables when a certain key is pressed.But the loader can't access the variables and change them.[code]
Right, is it possible to change the varaible of an object within flash (5) through the use of a textbox? The reason being we're doing a group project with Flash and MaxMSP and when a video camera picks up movement, numbers will be sent from MaxMSP through to flash.
Thus, when these numbers "arrive" in flash I want them to trigger certain events. For instance (where this code resides in the movie clip: 'tree'):
Here, the idea is that when '5' is sent to flash a tree will grow and when 4 is sent something else will grow etc... However, because I don't want stuff growing all the time I need to change the variable of an object. I presume a textbox would be the easiest way of going about it
I am doing some server communication in AS3 / PHP / MySQL and I was wondering if there was a way to change a variable just before the user closes Flash?
Example: User closes browser or tab and Flash updates a variable before it closes the player.
I would like to be able to send the message to the server so that it knows that the user quit as it happens.