ActionScript 2.0 :: Script Is Picking Random Names?
Oct 6, 2010
I have a script that when the use types in their name, it is to pick a random name from the list. Problem is, it isn't picking random exactly I get a lot of repeats and sometimes it just comes up undefined.Here is the script does any one have any ideas of what is wrong?
if (combobox.getSelectedIndex() == 0)
{
txt2.text = "Female Name";[code].....
View 2 Replies
Similar Posts:
Jul 23, 2008
I have one folder which contain few images. I want to pick RANDOM images from it through my code. How do i go in this.
View 1 Replies
Apr 5, 2011
I am using actionscript 3 and I am creating an array of 16 buttons and need to use the function math.random to get it to pick 5 random unique numbers out of the array. As at the moment it is sometimes picking 5 unique numbers and sometimes it has duplicate buttons appearing?
View 1 Replies
Sep 27, 2009
Needed to place objects on the stage in random order, but only place each object twice. [code]...
View 0 Replies
Nov 22, 2011
I have a flash container that calls other swf files and loads them and plays them one after the other.I upload/overwrite those files each month as new promos happen.the file names stay the same as they are defined in the container file.Im trying to find a way to add some kind of variable into the action script so it finds the file and adds the date in as well. This way when the browser looks at the files it will see new dates and then load the new file from the server as opposed to the local cache.Is there an elegant way to do this?Im using CS5, but it looks like the action scrip was written in an older version.[code]
View 3 Replies
Aug 26, 2010
We've got an Illustrator file with something over 1,000 layers. We're trying to import this into Flash and keep the layer names intact, such that they become the names of the movie clips that are imported for each layer and can be used programmatically. (It is a diagram and arrows, boxes, etc all have callout names that will eventually allow them to link to a database.)As near as I can tell, the Import dialog will NOT pass this info across between the two parts of the dialog.
View 1 Replies
Sep 27, 2010
with attaching a sound to a movie using AS, in this case, it is a car tire that screeches when rolled over. I added a "tailpipe" idle sound when we roll over the tailpipe of the car. I have attached linking to the sound file named, "idle", and copied the "screech" AS code and edited, but now all the screeching tires have picked up the idle sound. All the movie mechanics work fine. Here's the AS Code:(T1 & T2 are the tires, tailpipe is the idle movie)
T1.stop();
T1.onRollOver = over;
T1.onRollOut = out;
[code]....
View 1 Replies
Nov 13, 2010
We're working to build the front-end of our application and struggling with selecting a good UI framework since we're not experienced UI people (we're mainly back-end developers). The central issue is that we don't know what we don't know and don't know how to best weigh our different options.At the moment, we're evaluating Flex, ExtJS, and Vaadin. Is there another option we should consider? What, are the major elements we should evalutate on?
View 8 Replies
Nov 4, 2010
I have a movie that loads content from an XML file. The path to the file is passed in using flashvars. I am using SWFObject to embed the Flash in a web page. I have a routine that checks for an XML attribute from flashvars and if available passes it to a variable; if no XML attribute then it uses a default. Because I'm having trouble with flashvars I'm also displaying the path in a text box. The code looks like this:
[Code]....
View 3 Replies
Mar 20, 2011
I started a thread about a reference to a symbol House, in the output window, which was: House_1. A lot of people said some useful things about that. All day I've been thinking about it, and I came to the conclusion that I don't understand things, at a very basic level.
Consider:I make a movieclip which I give the Symbol name Drawer. (I don't export it for AcitonScript.)On the stage I manually place two instances of this Symbol. The first one I give the Instance Name drawer (in the properties panel). The second one I leave nameless.Now if I trace the names of both these clips, by
trace(this.getChildAt(0).name);
trace(this.getChildAt(1).name);
the output window gives me
drawer
instance2
Now I know that the so-called "instance name" which I gave in the Properties Panel (drawer) is, in reality, a variable name which Flash gives my first instance behind the scenes. And instance2 is a name that Flash gives my second instance. What exactly the nature of that name is, I do not know.My point is: both names (drawer and instance2) are the .name property of these movieclips. Otherwise I could not have traced them through asking for the .name property, in the above. Yet only the first of these two can be manipulated:
drawer.x can be set;
instance2.x can (as we know) not be set.
But...why? What is the real difference between these two kinds of names? How can they both be the .name property of their underlying movieclip, yet be of such a different nature? What IS the nature of the instance2 name? If it's a String, how come the .name property of one movieclip can be a variable name, while the .name property of another (but identical) movieclip is a String?
I've searched every bit of web page on the net I could find. But it looks as if nobody addresses this issue. We all just work with it - but it makes no bloody sense. A name property = a name property, you'd think. Whether Flash set it or I set it should not make a difference. The x property of a clip, for example, does not change in nature according to who set it - me or Flash.So, again, just to emphasize the problem: how can a property (the name property) of a movieclip change in NATURE depending on who set it? After it's been set, shouldn't the name property of a clip be of exactly the same nature as the name property of another clip?
View 8 Replies
Jul 30, 2010
I have a working AS3 project and it compiles fine to a SWF. I added a new file (via various means: import, drag-drop, new), but it doesn't compile this new file. I'm using Flex Builder 3. I've tried a clean an rebuild. I've tried renaming. It picks up the existing files fine, but not the new one. The project is set to use a HTML wrapper. I see some build files (I think). The new file is in an existing folder and package.
View 1 Replies
Sep 26, 2011
I am having an issue with picking up custom data types from a drop down lists. To make this as easy to understand as possible, I'll use a simple example of what I want to be able to doSo say I have a custom data type (Say of type Dog). Dog contains a name, breed and age. I store each instance of a dog in an ArrayCollection:[Bindable]private var dogData : ArrayCollection;This ArrayCollection holds 1..N Dog objects with the respective information. Now having a dropdown like so:<s:DropDownList x="81" y="178" id="dogSelected" prompt="Dog Selected:" dataProvider="{dogData}" labelField="dogNameData" />he dogNameData would hypothetically come from a custom ActionScript class that has the 'name' field of the Dog in that object.
Now I want to select a certain dog from the dropdown. I tried to just do it this way:var theDog : Dog;theDog = dogSelected.selectedItem;However, ActionScript does not seem to like this. Now, I read around and found out that using the label field is the way to be able to select this. I have been unable to select the dog item, so I can then bind it to:
var selectedDogBreed : String;
//var theDog : Dog = the selected object from my drop down
selectedDogBreed = theDog.breed
[code].....
View 2 Replies
May 23, 2005
I have a normaly created dynamic textfield to which i put something like "_root.MC_container.anyVar" on the variable field.
This textfield is part of a button, so, what i need to do is to redraw the button when the contents of the textfield changes. I have the whole redraw function working ok. But what i cant seem to achieve is to detect the change on the variable i've assigned to the textfield. The content changes, but no redraw function gets called.
I've tried with TextField.onChanged and adding a listener object to the textfield, but none of them seemed to work.
View 1 Replies
Sep 29, 2008
So I got my stage with a bunch of buttons in the middle of it. when you click one a little window pops up, alls good. Problem is that when my mouse is over that window it is still picking up the buttons underneath of it.
View 1 Replies
Mar 7, 2011
I have two mc's mc1 and mc2. on mouse click of mc3 i want a math random function and a logic argument of if math random =< 0.5 then play mc1, if mathrandom > 0.5 then play mc2. how would i right the AS3 for this?
View 4 Replies
Dec 12, 2009
I am running flash through an xml page. The page is a xml generated photo gallery per-say, and I can make it work for the 1st page, but not the sub menus.
XML PAGE
Code:
<title_submenu><![CDATA[APPETIZERS]]></title_submenu>
<content_submenu>dyn_xml_gallery.swf</content_submenu>
In the dyn_xml_gallery .fla file, I have it picking it up from
ActionScript Code:
xmlCategory.load ("dyn_xml_gallery_xml/categories.xml");
The main page picks this up just fine, and shows the pictures as I have listed. But on the submenus, I have the same thing but just different names. So instead of being dyn_xml_gallery.swf, it's now dyn_xml_gallery2.swf.
And in the actionscript, it's picking it up from dyn_xml_gallery_xml2.
With everything renamed and linked to the right object.. any ideas as to why my submenus are still picking up the original file, and not (in this case) my dyn_xml_gallery_xml2.
View 2 Replies
Mar 15, 2011
I have 16 instances of the same movie clip. The movie clip is made up of 16 frames, each with the picture of a face on it. I want it to work such that when I click my button, each face only appears once, so that all 16 different faces are on the screen. I have been trying to use an array containing the numbers 1-16, and removing them as they are randomly selected. However, with the splice function, I can't pick and choose which number is removed.
How to I pick a random number from an array of 16 numbers, and then remove that specific number from the array so it can't be selected again?
View 1 Replies
Nov 17, 2003
i'm trying to display text from a textfile in a dynamic textfield, i have a text file called "quotes.txt" wich has variables set like this:q0=text&q1=text2&q3=text3 etc.so how can i pick these q's at random and place it in my textbox?i've tried this:
loadText = new loadVars();
loadText.load("quotes.txt");
quotes="q"+Math.round(random(10))
[code]....
View 14 Replies
Mar 12, 2006
I am really new with flash and yet I needed to construct a simple one level game. What I have now is kinda similar to pacman but a bit different.
1) Lets say, like pacman, the user's character need to pick up things in the maze. but instead of the items are already there, i would like to have some already there and then when the user pass the path, some will randomly appear in the maze. e.g : like the fruits that will randomly appear in pacman.
2) How to make the bad character constantly chase the user's character throughout the game. only one bad character in this game chasing.
View 2 Replies
Mar 12, 2010
Let's say a user can pick fifty different hat colors and styles to put on an avatar. The avatar can move his head around, so we'd need the same types of movements in the symbol for when that happens. Additionally, it gets which hat should be on the 'avatar' from a database. The problem is that we can't just make 50 different frames with a different hat on each. And each hat symbol will have the same movements, it'll just be different styles, colors and sizes. So how can I make one variable that is the HAT, that way we can just put the appropriate hat symbol into the variable and always be able to call Hat.gotoAndplay('tip_hat') or any other generic functions.... Does that make sense?
View 2 Replies
Aug 22, 2005
can't figure out why the dynamic text boxes in my dynamic clip arent picking up the variable when I loop through this recordset!the trace (you'll see here right after I try two ways to assign the variable) traces the correct info back..
[code]...
View 1 Replies
Mar 17, 2012
i have a "swf" file which is picking url from xml & displaying the image, when i tested it locally it works fine, which means it picks up URL from XML & displaying corresponding image. After i uploaded it on server, it doesn't show anything.
View 2 Replies
Nov 17, 2003
hi, i'm trying to display text from a textfile in a dynamic textfield, i have a text file called "quotes.txt" wich has variables set like this:
q0=text&q1=text2&q3=text3 etc.
so how can i pick these q's at random and place it in my textbox?i've tried this:
loadText = new loadVars();
loadText.load("quotes.txt");
quotes="q"+Math.round(random(10))
loadText.onLoad = function() {
tester.text = this.quotes;
i thought i could replace the direct reference to q0 or q1 etc into a variable "qoutes", so how can i do this so it does work?
View 14 Replies
Jul 20, 2004
i got this email form from flashkit and it works fine - i just need to add an extra field called phone number. Unfortunately the PHP file is not picking the "phone" variable up?
View 2 Replies
Dec 17, 2011
Is it putting the first random var and then the second, like this?
frases.push(myXML.pais.frase1[ps][r]);
View 1 Replies
Sep 30, 2006
I want a movieclip consisting of a dynamic text box that, from the time it's loaded onto the stage, loads a randomly selected text string from an array, and continues to loop until the clip is removed from the stage. I also want the text strings to appear in the text box for random intervals between 500 and 3000 milliseconds.
While I've found tutorials here and elsewhere on loading one element from an array, usually triggered by a button, I don't know how to combine/alter it with the other elements.So I want this movieclip on the stage randomly flashing phrases from an array, some for a barely perceptible time, and others for a readable time.
View 3 Replies
Feb 26, 2012
why is this code NOT loading a random image, despite tracing random number?
package {
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.*;
import flash.net.URLRequest;
import flash.display.MovieClip;
[Code]...
View 3 Replies
Mar 3, 2004
What I want is for my mc to slide to a new random x position when it is less than 5 pixels away from its target, it keeps doing this. the problem is for some bloody &*�$(()** reason my random numbers only keep going up!! why is this?? i want to produce random numbers between 1 and 770 - this is my code..
[Code]...
View 5 Replies
Feb 11, 2009
I've been putting data into an array via XML, and then selecting at random an image string to load in a pic at random. But whilst doing this, I wanted to remove the String from the Array that I have just used, so I don't get repetition of the same image in the output. I initially thought that pop would remove the string I had just used - But of course it Removes the last value in the Array instead, which doesn't really help.
Ok - so how about randomizing the data once inside the Array, after it has been pulled in from XML!? That way I can load in the 'last' image, and then pop it out! Keeping a randomized selection of images each time 'it' is loaded
View 2 Replies
Nov 18, 2010
1) what value is seeded to Math.random() to generate the random number?
View 2 Replies