ActionScript 2.0 :: Choosing A Random Movieclip?
Sep 8, 2008
I'm trying to achieve the following:
On my stage are 8 movieclip, respectively called squid1 to squid8. I'm trying to make actionscript designate one of these 'actors' at random once in a while, and make it pop up/do something. Dont know what exactly yet. Here's what I'm working on...
Code:
function chooseActor() {
var pickNumber = (Math.floor((Math.random()*8)));
var result:Object = new Object();
[Code].....
Now chooseActor funtion does what I intend it to do, i.e. generate a variable consisting of the word 'squid' combined with a number. I expected I could simply use this variable as the name of a movieclip and then just unleash all sorts of wackiness on it. But it doesnt work.
View 5 Replies
Similar Posts:
May 19, 2010
What coding would I write so when a user presses a button, it selects a word from the words within the text?
View 3 Replies
May 25, 2009
So I have a movie with 20 frames...on each frame...there is a question...so I want the user to access that pool of questions...when it pops up...it will randomly choose a Frame to go to...Now...how do I go about...when that Frame is chosen...take it out of the pool of the random questions...so it doesn't land on that frame again...I'm thinking with variables maybe...but I actually don't know how to even begin to write the code for that.
View 1 Replies
Jan 27, 2011
What coding would I write so when a user presses a button, it selects a word from the words within the text?
View 21 Replies
Aug 5, 2005
I m choosing random numbers. I want to be able to choose any number from 1 to 10. Let's say for example, 4 is chosen. I then want to be able to choose any number from 1 to 10, aprart from 4. Let's say 6 is chosen. I then want to be able to choose any number from 1 to 10, apart from 4 and 6. And etc, until all of the numbers are chosen. I was hoping someone could recommend the best way to code the above.
View 4 Replies
Dec 1, 2009
How to do math calculations in AS2? I only need + and -. Aswell, how to choose a random number inbetween 2 and 6 and put in a variable form. After this, I need to do a calculation like:
Code:
"currenthealth" - "random"
View 1 Replies
Dec 29, 2002
I've got 12 MovieClips, which all have specific functions in the movie. Those MC's will appear and dissappear after a few seconds. But what I want is, that those MC's have to appear at random .If all 12 MC's have appeared, the appearance has to be stopped. So for example MovieClip number 4 has to appear just once. So 12 MC's will appear, but everytime when the movie starts, the appearance has an other sequence.What is written above I want to place in an other MC. So there is one MC which 'load' 12 MC's within it
View 2 Replies
May 6, 2010
What's the best strategy to handle allowing others to embed your own swf on a site of their choosing?
We're finishing up work on our new video player and while the embedding is working fine within the same domain (complete with a cool backend tool that tracks & lets us turn off individual embeds by ID number assigned during embed), I'm having some trouble testing across domains.
This will work like YouTube et al; people will simply be pasting HTML code into a page on their site, but the swf and all assets (images, XML files for data, etc) will be coming from our own site.
View 2 Replies
Oct 15, 2009
Our team is about to start a SAAS web application geared toward small businesses. This is a completely new experience for us; we are a system/ linux/php development organization and no experience whatsoever developing client side software except for simple html/php based CRUD support applications.We are evaluating both Adobe Flex and JQuery. We can't seem to choose between the two. Our priorities are:Productivity - We have to launch the soonest possible time.Overall User Experience - Resulting apps have to look professional and user must have pleasant experience using our product. I think this not a problem with both platform, though we will probably automatically lose 10% of potential users who don't have flash installed.Skill Reuse - We will all have to learn new language(s) and RIA platform on this project and hope we can use it again on more projects. BTW, we are a software contracting organization and this is our first foray to consumer apps. We are hoping though that we can leverage the skills we gain here for our clients.
Data-centric - Lots and lots of CRUD operations.3-tier - Business logic will reside on PHP server and data will be on the MySQL. The RIA will only present the data to the user.User accessible data will be large - This is why we decided to use RIA. We can't refresh the page when user just made few alterations/additions.Security is paramount - I don't see any security implication on choosing one platform over the other but perhaps the community has some ideas? We are carefully studying this. We frequently hold competition among developers who can implement a test app faster by using a flex or jquery. We would love to hear what the community have to say though.
View 7 Replies
May 25, 2011
I am looking for easy customizable charts. For example, i need to do this chart.So...What is best technplogy, flash, silverlight(on server side asp.net WebForms), js. Is it good idea to write own chart conrols without based on exists controls?
View 2 Replies
Oct 24, 2011
We have hooked up a Kinect to Flash and using it to control an avatar inside Flash, then we added another player in the Kinect and control the avatar using both players. One arm and one leg each. Now the problem comes. We want to mix it up during a game we are making. So, we need a function on a timer that randomly selects an arm and a leg from each player. But we gotta be sure that we don't get both arms/legs from one player or vice versa.We thought about using the Array and using several math functions in order to get the final result, but I was hoping there was a better way?[code]
View 1 Replies
Mar 7, 2012
For a new application I need to make a decision on what frontend technology to use. I know this question has been asked before and I've found several studies, blogs and other references discussing Flash vs. Silverlight vs HTML5 vs JavaFX, but in my case there is a business requirement that complicates the situation.The application must run as an offline, stand-alone desktop application and as an online client-server application and perhaps in the future it needs to run on tablets as well. And to minimise maintenance we would like to have just one code-base. The server side should preferably run on Linux.
From earlier projects we have experience with Java and Flex for the client-server configuration, but I haven't found out if it is possible to package this into a stand-alone application. Java and JavaFX would be an alternative, but JavaFX still seems to be immature and lacking development tools. If we go for Silverlight we would more or less have to switch to C# or C++ for the backend, or use something like JNBridge, which would make the stand-alone installation more complicated. And HTML5 would be the choice for the future, but less suited for a complex application and we might run into browser-dependencies.So I haven't found the ideal solution yet and could use some help. Perhaps we need to limit the one code-base requirement only for the server/backend side and accept different front-ends for different usages.
View 3 Replies
Apr 4, 2012
I have four possible directions on a grid (right, left, up, down) and I've already determined how to make a Boolean array to determine which positions are possible, returning something like (true, true, false, true). What I'm trying to figure out now is how to randomly choose one of these without choosing a false one. I've tried several permutations of If and While to no avail.
This is the closest I've gotten:
var rOrient:int = Math.floor(Math.random()*orientArray.length);
var orientDecider:int = 4;
while (orientDecider >=3) {
[Code].....
but the problem is, that by splicing the Falses from my Array, I can no longer match up the index number to (Right, Left, Up, Down).
View 2 Replies
Nov 17, 2009
I have a line of code like this:
var myObj:[SomeClass] = new [SomeClass]();
I want to choose which class this object will belong to randomly at runtime. Is there a way to do this in Actionscript 3?
View 6 Replies
Dec 30, 2009
I writing a small action game in actionscript and I'm adding some mulitplayer features. I am currently using xml sockets and a small java socket server I wrote.
But I am now pondering, would my game have connection problems when people try to use ? wouldn't they need to open the port I used in their firewall and configure port forwarding in their routers ?
I did a small test over port 8080 and some remote computers running my swf connection test, they got connected but the connection was lost right away... is that a "cross domain" issue (I didn't learn the subject yet) or should I check the firewall and etc on the remote computers ?
Also, I am pretty early in the process - should I consider switching to RTMP to avoid connectivity issues ? Do commercial sites with multilayer flash action games use sockets for the connection ? Does electroserver/pulse/etc.. use sockets under the hood or RTMP ?
View 1 Replies
May 14, 2010
ive got xml file which in:
HTML Code:
<easeType easeType="Bounce.easeInOut"></easeType>
and after xml loaded to flash i set variable which is actually set up in function after starting flash movie to just refresh values of variables:
ActionScript Code:
newEasing = setupXmlList.attribute("easeType");
changeSetup(newEasing);
[Code]......
but there is no any change whichever easing i choose... I think there is some issue with refferencing objects, as from XML there comes String and in the TweenLite constructor i pass a string when i think some specific object is required.
View 3 Replies
Oct 7, 2004
I am importing a movie with
Code:
loadMovie("test.swf","content")
were content is a little pink box with instance name content. Now my question is , how do I choose which frame the imported movie is on. I want to be able to go to a certain frame in it and stop preferably with no code in the imported movie if its possible.
View 4 Replies
Nov 7, 2005
What's the command for choosing the biggest value out of for ex. 5 variables? Math.max(); can only take 2 values.
View 2 Replies
Apr 26, 2009
I have several arrays:
Code:
arrayEquipment
arrayBoots
[code].....
View 3 Replies
Sep 16, 2009
I'm interested in understanding the ActionScript 2 code that will allow a random decision on the next marker to jump to. I have five markers on a time line and want the movie to stop after playing a sequence of elements, then randomly choose the next marker to jump to and play, this would continue forever.The goal is to communicate a few concepts without starting from the same concept every time in a linear manner.
View 6 Replies
Feb 28, 2011
I've taken a few Flash classes, but this is the first I've really been exposed to hard coding things into the stage area.
I'm working on a game, and I need to have the game randomly choose one of four movie clips to add to the stage after a given event. (ex: Mouse click)
The four movie clips are BoostUp, BoostDown, BoostLeft, and BoostRight.
View 5 Replies
Aug 26, 2010
I am working on a project where i need to support multiple players and platforms to play videos. Major Platforms will be: Windows PC,Mac PC,Apple Devices and Android. This is the precedence i will be following. First it will check browser support for Silverlight 3 or later then Flash then HTML5. If not any one of them is supported user will be asked to installed Silverlight. I wanted to know which pattern and strategy i should use in order to support this functionality. Currently i have investigated about some javascript api that can do this detection on client side easily and load the player appropriately.. but as many of browser could be without javascript support so this method will fails to play videos. Is there any way I can do this detection on server side and inject proper Player HTML on client end?
View 2 Replies
Dec 23, 2010
I am wondering if Flash / AIR can find all these mobile devices front facing camera and use RTMP to stream the video captured? I would like to create a video conferencing app for these devices. Of course none of them support testing this in the simulators and I don't have the funds to purchase or access all of them that I would like to test. I have seen some posts where they have done this for android but not sure about support for finding a list of cameras, choosing one and streaming from iphone 4 and playbook.
View 2 Replies
Nov 27, 2003
I have a text input field and I need a combo box for choosing the font size for the text by px maybe.
View 1 Replies
Nov 28, 2010
I need the exact simple application but the ability to choose a background image from a file on the server as the canvas and I want to save the created image on a server file instead of on the client machine. The ability to change the pencil drawing size would be an additional plus. I work with php and mysql so I would like to use them to store the file parameters, even as a blob in mysql, along with some additional user (server) defined variables (I can do the php/mysql side if I can get the file there, I understand there is an swf to png ByteArray class that might be able to save on server. The project is for an opensource group so the final product would need to remain as such, I would be able to pay for the modifications mentioned above. The source files are available at the links below. [URL]
View 1 Replies
Jan 7, 2012
I want to be able to choose three differents colors from a color picker. I want to choose between red, green and blue. How can I change my code below to do this? Should I have my color picker in its own class?
public class SuperDraw extends Sprite
{
private var loadImage:LoadImage;
[code]......
View 1 Replies
Apr 29, 2003
I have a movie with one frame, and movieclips which can be filled with color are attached. The drawings can be printed with color, but the whole stage is printed and the #b thingy doesn't seem to work. (I've got a box with the wanted print size on a separate layer named #b). If I create a keyframe on frame 2 and move the boundary box there, the print size is adjusted to the box, BUT... the colors are not printed, and all the movieclips which have _visible = 0 are also printed. So it seems I have to choose between printing the whole stage and printing the wanted area without color and with hidden lines...
View 2 Replies
Aug 10, 2011
I am using this random code below to choose a quote to display and I want to move the quotes list to a text file.
Code:
quotes = [Fish are the last to recognize water.","I am my brains publisher.", "Every tool carries with it the spirit by which it has been created.","Curiosity is the mother of intelligence.","Thinking is drawing in your head.","A person without imagination is like a teabag without water.","Realism is a corruption of reality.","Its always better to be looked over than to be overlooked.","The hardest thing to see is what is in front of your eyes.","The soul has no secrets that conduct does not reveal.","Creativity is the defeat of habit by originality.","Those who cannot remember the past are condemned to repeat it.","If you want to get lucky... it pays to get ready" ,"Realism is the corruption of reality","I'd give my right arm to be ambidextrous.","Music is noise submitted to order by wisdom.","God...invented the giraffe,the elephant,the cat.He has no real style.He just goes on inventing things.","The person you love is 72.8% water."]
qNum = Math.floor(riddles.length*Math.random());
partThree = quotes[qNum];
mainTxt = """+partThree+""";
View 1 Replies
Feb 12, 2010
If I have my date field/chooser set to show today (current day will be highlighted when selecting a date) can I disable the user from choosing dates that fall before the current day?
PHP Code: <mx:DateField id="choosedate" showToday="true"
This is from the adobe live docs. I'm trying to figure out if there's a way to change it to suit what I've stated above. Or maybe it's done a completely different way...
[Code]...
View 3 Replies
Oct 20, 2010
but I've spent the last few days trying to find an answer to this seemingly simple question, and no luck. Well, partial luck, but not quite what I wanted.My problem is this - I want to play a random sound when an event happens. In AS2, I used to do this:Actionscript Code:s1 = new Sound();_root.s1.attachSound("sound"+(random(10)+1));s1.start();...where there would in this example be 10 sounds in the library, with names from sound1 to sound10.Now, I want to be able to do the same in AS3. As a temp solution, I've been forced to do a lot of if statements, but that's ugly, timeconsuming and inefficient.I also tried this (AS3):
Actionscript Code:
var soundArray:Array = new Array(new sound1(),new sound2(),new sound3(),new sound4(),new sound5()) var randomInteger:int var selectedSound:Sound function
[code].....
View 4 Replies