ActionScript 3.0 :: Create A Totally New Var?
Oct 28, 2011
I wonder if it is posible to create a new variable in actionscript like this...
ActionScript Code:
//create a new variable
var ["new_var_" + myNumber]:Array = ["hello, hey, more_silly_stuff"];
//putt my new variable inside my old Array
row[myNumber] = ["new_var_" + myNumber];
If you understand what I want to do, is it in some way possible to acomplish this?
View 9 Replies
Similar Posts:
Jun 13, 2010
So, I popped open up Flash CS5 just now, and I couldn't find my projects panel. I was working on a dual screen set up previously, so my windows were everywhere anyways (sans external). I switched over to a smaller screen workspace, and popped opened the projects panel. Oddly enough, the code snippets panel came up instead. So, I switched off the code snippets, and tried again. I've been trying different ways of opening this panel for about 15 minutes, and I'm totally stumped. Some thorough googling didn't present any relevant results, so, StackOverflow, I turn to you. Is this a known issue? is there a secret backdoor way to open this panel?
View 1 Replies
Jun 16, 2011
I am working on a project that plays a sound when the mic input does not detect any sound.When I close the preview in flash I get no error but flash cs5 totally crashes.I suspect the computer cash fills up with the information about the mic input and can't handle it anymore so crashes,but I am not sure and don't know how I could fix this. I do know when the animation_mc.play(); is removed it does not crash.(In my animation_mc are the audio files that should be played when the mic does not detect an input.)
Here is my main code
Actionscript Code:
var verdergaan = false;var mic:Microphone = Microphone.getMicrophone();mic.gain = 50;mic.rate = 8;mic.setLoopBack(true);mic.soundTransform = new SoundTransform(0, 0);mic.setSilenceLevel(20,
[code]...
View 1 Replies
Mar 23, 2010
I have a .fla that contains five movieclips, and have a couple of questions regarding removing movieclips and swf size.If all the movieclips are displayed, my resulting swf is about 50k.If, in frame 1, I code conditionals that decide which of the movieclips will be displayed, will the resulting swf size become smaller if some of the clips aren't displayed?If so, what is the correct way to totally remove a movieclip from memory? Say I have a main movieclip that contains 5 other mcs, and the as code is within the main movieclip.If not, is there a way to make the swf size smaller if less than all clips are displayed (using conditionals).
View 10 Replies
Apr 10, 2010
Attached mcs from library are totally different sizes.I'm attaching them for my gane but they are totally different sizes. If I scale them that doesn't help because then the big ones become too small.If I fix their size and width some look ridiculous.Is there anything I can do?
View 2 Replies
Jun 27, 2011
I would like to create an totally re-sizable application using Flex 4.5. I experimented already but my approach seems to be hard to maintain so it does not look good to me. Here is my approach:Concerning the HTML I actually have a first page which detects the user's monitor resolution and then redirects to the flash container HTML(a JSP) which reads the width and height parameters and renders the flash to the size passed.In my application I used the 1280x720 as the reference size so I have created a utility class:
package utils
{
import mx.collections.ArrayCollection;[code].....
I pass the percentage value relative to height or width and I get back just that. So I actually bind the height/width of components to e.g {LayoutUtils.relativeToWidth(50)} which would return 640 if my applications width would be 1280. But this means setting width and/or height to almost every component and this includes also padding and anchor positions which makes it a mess. I want everything to be re sized correctly(including fonts). All the available sizes I am going to have available will keep the same aspect ratio which is going to be 16:9 for example because I can't see any other way of doing it
View 1 Replies
Feb 22, 2009
We are using PopUpManager to bring some screens up, and every time I create one, I need the new one to be totally unique from the old one. Right now, every time I create a popup, it has cached the last one in memory somewhere, and the variables are all still set.
View 0 Replies
May 30, 2011
I'm trying to build a simple timer application in as3 that counts down and then plays a gongsound. easy right?There are 3 buttons that should change the time from 2,3 and 4 minutes. Default time is 3 mins but the buttons never change the time and I can't figure out why, the trace tells me the boolean values have changed but the time is always the same..To save time I changed the times to 3,5 and 7 secs. here is the code :
ActionScript Code:
//time selection buttons
var time;
[code]......
View 6 Replies
Mar 11, 2003
So I am tring to load a movie into a target. It is loading but all of the scripts are not working (some of the scripts are working). All the scripts work if I load the movie to a level instead of a target. But I need the movies to be in a target because of the motion that I want to apply to the loaded movie
View 1 Replies
Mar 31, 2010
When you're working with a class that has both a private and a public function by the same name (something like playVideo())? Often my public playVideo() function only provides a hook to the real private playVideo() function, which will contain more functionality. Should I use an underscore in the private version -- _playVideo() -- or is there some better way to do this?
I know it's a matter of preference and there really is no right or wrong way, but I haven't been naming all of my private properties with the underscore so it seems odd to start now with only *some* of them. This sort of trivial thing has bugged me for a while, so I finally decided I should get it settled.
View 6 Replies
Dec 4, 2010
i developed a social network using flash (actionscript 3) , php and mysql and it interest in some fields of science.i would like from you to test it (if you find any mistake please tell me)
View 1 Replies
Feb 24, 2012
I have a banner ad which contains an flv player. Due to size restrictions for banners at the site, I've found a player which I think will do the trick (chrometaphore). However, the site in question does not allow anything more than the actual swf for the ad, so I cannot include the com folder for the player and need to include all AS3 code in the swf file. I'm not a scripting genius, and wonder what it would take to include all the classes in the AS3 file contained in the swf. Is it possible? Does anyone know where I can find a VERY lightweight player whose entire code is contained in the fla?
[edit]: It just occurred to me that if the flv is on a remote server, could the com folder and files also be remote? Currently, the path for the com files looks like this:
import com.chrometaphore.display.video.colibri.Colibri;
import flash.media.SoundTransform;
What would that script look like if it was pointed to a remote com folder?
View 1 Replies
Oct 23, 2009
I have several buttons wich loads movies into a movieclip. When you hit once, it takes 1,5 seconds when the flashy makeup is final and the content is visible.When i hit a button 2-times the website turns into a epilepsic repeated load.
Check the code:
/* a node in the tree has been selected */
treeListener.change = function (evt:Object) {[code].....
I want to freeze my animation totally during processing, so that:
1: click 2: processing, takes 1.5 second (button is disabled) 3, after 1.5 second: finished (button is enabled)
View 6 Replies
Mar 23, 2010
I have a large creation in process that requires a lot of heavy animations and movement with vectors and really processor intensive. Just want to know, regardless of whether the project is huge or small, how to totally stop a class from working? I have three classes I am calling. "class1 = new Class1();" etc. When I am in the level, say, class2, I can still talk to objects in class1 even though I removed the class listeners within that class1 after I was done using it. It still is able to be called upon, and still running something in the background that I can't figure out what it is. I just want to know, rather than searching for whatever is causing the problem, can't I simply null the class that I never ever need to use again?
I tried that, but then I ran a trace and it still tells me that it is a class object. I reckon its because I have a "public var class1:Class1" etc, which means they will always have those objects associated with them, but still. I want to totally get rid of it for garbage collection, and because I don't want to use some of them at all, ever again. So basically, what is the best way to get rid of classes so that they aren't hogging up resources any more?
View 2 Replies
Feb 10, 2010
I have simple combobox component in flash cs4, I try to add and event listener like this
mycombo.addEventListener(Event.ADDED_TO_STAGE, added);
function added(e:Event):void
{
trace("HI");
}
never get called even if I have the component in the stage manually or via AS, but if I add a listener to MouseOver it works, why the ADDED_TO_STAGE event don't work, also I have a problem with the textFormat style if I use
mycombo.setStyle("textFormat", tf);//suppose tf is a TextFormat object
doesn't work too, but if I put that line inside the MouseOver event it work's why??
View 1 Replies
Mar 22, 2011
I am working on a video player in Flash CS4. I'm trying to build the player such that when the user moves their mouse over the flash object, the playback controls appear and, when the user moves the mouse out of the flash object, the controls disappear.I managed to get some code put together that works in every browser but one: Internet Explorer. Well, it 'works' but only if you slowly move the mouse out on the left side of the flash object.I have done quite a bit of Google searching for an answer, but I can't seem to find someone with a similar problem.Code is as follows:
ActionScript Code:
root.onLoad = function(){
_root.clip.skinAutoHide=true;
[code].....
View 1 Replies
Apr 5, 2010
im using this code for my movie to pause for a certain time and then it play every after 5 seconds
stop();
var nInterval = setInterval(Play, 5000);
function Play() { clearInterval(nInterval); gotoAndPlay(_currentframe+1);}
[code].....
View 8 Replies
Mar 15, 2012
My question is simple: is "Shape tween" the only way to animate two totally different colors, say, for ex, green to red?
View 7 Replies
Nov 14, 2009
I'm trying to create a series of scripts that will create some custom event listeners.
I have three movie clips on my stage. One is a movieclip who's sole function is to hold array's and the event listeners. A second which moves around the screen. And a third that is motionless.
The problem is that the argument I want to test (which activates the custom event) is held within a string.
What I want to know is, how do you test to see if the string argument is true?
Is it something similar to this:
var myCode:String="1<0";if(myCode){
trace('one is smaller than 0'); //Strangely apparently one IS smaller than 0!!!
}
I think I'm going about this in the wrong manner, however this is the only way I can think of this working... (since I need to be able to dynamically create these events)
View 7 Replies
Sep 29, 2010
I'm trying to create a flash program that uses it's own code to send and create images. Each square has a colour and that colour gets added into the array. A black, then grey, then white is:
filecode = ["Bl", "Gr", "Wh"];
That works fine, but when I try to paste it into an Input text box it will only fill in the first part of the array.
filecode = ["Bl,Gr,Wh"];
So the program has NO idea what I want.The only ways I can think of fixing this is by putting in 402 text boxes to suit every box...But every one of them needs a Variable Name.Or by sending the information straight into the array. But this way you are just looking at what you just drew, and that is not at ALL practical.
View 3 Replies
Aug 26, 2010
Is the only way to create a style sheet to create Objects for each element?
import fl.controls.TextArea;import flash.text.TextField;import flash.text.TextFormat;import flash.text.StyleSheet;
I do this when a user clicks on a MovieClip:
var style:StyleSheet = new StyleSheet();
var heading:Object = new Object();heading.fontWeight = "bold";
heading.color = "#FF0000";[code]...
View 1 Replies
Jan 26, 2007
It is possible to create a menu in the contextmenu making it possible to create a window (component�) ?
example:
function tab()
{
}[code]....
View 2 Replies
Mar 21, 2004
OK frame 1 new fla and I type the following code:
[AS]createEmptyMovieClip("clip1",0);
clip1.createEmptyMovieClip("clip2",1);[/AS]
I have tried over and over again to get this to work but it won't! I want to create an empty MC and then create anoth MC within the first!
View 5 Replies
Oct 19, 2006
At the moment I create an onEnterFrame function to ease a movie clip into view. I then delete it. I want to be able to recreate a similar onEnter Frame function later to swoosh the movie clip out of view. At the moment weird things happen when I try and do the second onEnterFrame.I know I could put this all in the original onEnterFrame, but I don't wanna be wasting processor time doing an if statement every frame to work out if it's time to swoosh out the movieclip. Or should I not worry because that's negligible cpu time?
View 3 Replies
Feb 24, 2009
I am trying to create dynamic variables. Lets say: I read a file where I have: building, restaurant and hotel.
[Code]...
View 1 Replies
Aug 29, 2007
I've been playing around with custom classes. My objective was to create a custom class (Testing) that would create a box when an instance of the class is created. I've tried three different approaches, however only (3) seems to be showing up. I'm just curious why (1) or (2) doesn't work?
Also is there a better approach than (3)? Since at the moment it's been created on _root. I hope the box can only be accessible through the instance. Since I'd like to incorporate the whole idea of public, private, encapsulation, etc.
[Code]...
View 3 Replies
Nov 29, 2007
create a rollover button that once hovered over would create the snow and once 'un-hovered over' (<---:s) the snow would stop falling. I tried creating the button but kept getting errors etc.... Im a total noob (been using flash for about 1 month) if you could give us a hand that would be great....
View 5 Replies
Feb 23, 2010
I am trying to do is create an "app" with flash that will allow an employee of the company to create there business card on the fly. The business card templates will have been pre approved and uploaded into the "system". The employee will be able to choose the card template that he likes the most and edit information on the card template such as Full Name, Title, Office Number, Cell Number, Fax Number, and Email. After he inputs his own information onto this template he will have the option to save the file as a pdf file, that will be used to print his business cards.
View 1 Replies
May 17, 2011
I'm new to Flash AS3. I started making a game and I am a bit confused. Let's assume that I want to create a game that has multiple levels/modes, how can I do this in an object orientated way?
When i create games in other languages e.g. XNA C#, i create a separate class then create an object of that class within the main class and run the game based on a simple statement.
[Code]...
View 2 Replies
Jan 28, 2009
[Code]...
I get "Error #1056: Cannot create property _ld0 on tsl." error.
View 4 Replies