Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Pick A Random Image And Ask A Question - Please Help



Hi people,My first time here and i was wondering if you could help me.I am trying to build a simple flash game and was wondering if you flash guru's could help me.I would like to be able to pick 1 of 8 images in the library at random and display it on the canvas. Once the image has been displayed i would like 3 symbols to be displayed underneath. 1 is correct and 2 are in-correct.Get the symbol right first time and it's worth 3 points get it right second time 2 points and 3rd time 1 point. So the less accurate you are with your answer the less points you get.Once the right symbol has been chosen it adds the points to a score total sheet and then selects another random image out of the remaining 7 images.Once all the images have been used up it gives your final score! :)Of course i appreciate that you people arnt going to give me a finished game but i would appreciate some pointers to help me build it myself.I'm stuck on the random images selection from library expecially and also that need to take away answered questions from the images list. Any help on this would be fantastic.Thank you in advance :)



Actionscript 2.0
Posted on: Wed Jun 13, 2007 3:53 pm


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

S.O.S. (random Pick)
i am trying to use a random code that picks between MC1 and MC 2 at random intervals but NEVER picks the two together. The way i set it up is:
i have two main movie clips on the scene ("mainMC and engine")
One clip is the engine with the actionscript, and the second contains the two random MCs. ("MC1 and MC2")
The main movie clip designed as an engine has 3 actionscript frames in it.
• The first frame within this engine MC has the script:
seconds_low = 2;
seconds_high = 8;
rand = Math.round(Math.random()*seconds_high)+seconds_low ;
start_time = getTimer()/1000; move2 = math.round(math.random());

Random Pick Of MC
Hi,

I want a script or action that randomly pick a movieclip out of a folder of mc's, how can i do that?

Pick Random Value In Array And...
Hello

How do I make a random choice in an array, and when a certain object is picked, the next time it can't be picked, only after all the objects in the array have beem picked. For example:


Code:
cities = new Array();
cities = ["New York", "London", "Rio de Janeiro"];


Say that in the first time, the function randomly picks index number 1 ("London"). In the second time, it can only pick either indexes 0 or 2. If it randomly picks 0 ("New York"), the next time it can only pick index 2... when it finally picks index 2, the function sees that all the possible indexes have already been picked, then it starts over, meaning that in the fourth time you can pick any of the three indexes.

I have tried to do this using loops, using length, splice, slice, everything, put I think I am too slow to figure out the problem! Please help meeeeeeee!!! :confuse:

Best regards
Daniel

Random Array Pick
Quick question.
Can someone please tell me how to randomly pick an item from an array.
So if the array was called "numbers", how to randomly pick an item from the numbers array and store it in a variable. thanks

Pick A Set Of Random Numbers
I have 100 numbers (1 through 100), and want to pick 10 random numbers from this set. Normally I would do

for (i=1; i<=10; i++) {
myVar = random(100)+1;
trace(myVar);
}

but this time I need all the random numbers to be different (thay can't repeat). How would you approach it?

-Bartosz
www.BGPORTFOLIO.com

Pick Random From An Array
Hi!

I have an array of mc:s:
pictureMC = [mc1, mc2, ... , mc60]

they're all small pictures in a movie .. and I want them, from being invisible to light up in a random manner on by on or more don't really matter.. so how do I pick them up from a random function and light them.

Maybe the lit ones should get true or something so they' d get exluded from whatever function.. man I'm stuck!!

Can I Pick A Random Frame In An Swf File?
I have a swf file that say on frame 1, I'd like to randomly have the movie jump to either frame 2, 3, or 4. Is that possible, and how would that be accomplished. Thanks for your help.
chad

How To Use Random Function To Pick A Frame
hi all if i have a movie clip with 11 frames and there is a blank frame at the start with stop action


what is the code if i want to pick a random frame from frame 2 to 11
but any frame ((((( were piked we can not pick it a gain ))


this is the trick :)

Button Pick Random Mc ? But With Timedelay ?
Im making a litte game and I need some code on a button that when pushed down random choose betwen 3 mc´s. But when you push the button there have to be some time delay before the random choosen mc appear or starts....

I have attached a fla.....not the one from my game, is there anyone who knows what code you can put on the button so when pushed wait betwen 5 and 10 sec. (I mean sometimes it starts after 5 sec. and sometimes 7 sec. etc)

The fla file can random choose betwen 3 mc´s, but how to make the code that makes some timedelay ???

Please ???

MX - Button Pick Random Mc ? But With Timedelay ?
Im making a litte game and I need some code on a button that when pushed down random choose betwen 3 mc´s. But when you push the button there have to be some time delay before the random choosen mc appear or starts....

I have attached a fla.....not the one from my game, is there anyone who knows what code you can put on the button so when pushed wait betwen 5 and 10 sec. (I mean sometimes it starts after 5 sec. and sometimes 7 sec. etc)

The fla file can random choose betwen 3 mc´s, but how to make the code that makes some timedelay ???

Please ???

Pick Random Swf And Load To Movieclip
Hey dudes.

I have this script on a frame which loads .swfs into clips:
Code:
stop();

_root.whatLoad = "middle";
mtClipLeft_mc.loadMovie("homepageLeft.swf","homepageLeft");
mtClipRight_mc.loadMovie("homepageRight.swf","homepageRight");
Except I would like to change the homepageLeft.swf bit into a random bit.

What I mean is:

I will make a folder called homepageleft and inside this folder I will have .swfs called "homepageLeft01.swf", "homepageLeft02.swf" etc.

I want the above script to be able to pick a random number based on the number of possible .swfs there are to choose from (say 5) and then add that number to the end of "homepageLeft" and then add ".swf" onto the end... does that make sense / is that possible? Thanks for any help.

Peace


edit. just re-read and it doesnt make a great deal of sense huh?

to clarify.

I want movies to load on the left hand side of my homepage. This works fine so far as i only have one movie "homepageLeft.swf". Groovy.

The next step is to have a selection of possible movies to load and to pick a random one and load that. They will all be the same dimesions but rather large - hence the separate movies (each will have a preloader built in).

Thanks again for any help

Pick Random Images Without Duplicates
Hi,

I'm trying to write some script that pulls images from an xml file into an array, and then randomly picks out 5 of those images without selecting any duplicates, this is the code i have so far, but i'm not too sure how to tackle the duplicates issue? If anyone could help me out i'd be most grateful


mugShots = new Object();
mugShots.length = 0;

myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success) {

total = myXML.firstChild.childNodes.length;
path = myXML.firstChild.firstChild
imagePath = "http://www.monstermob.com/images/reskin/mugshots/";

for(i=0; i<total; i++){
item = new Object()
item.id = path.attributes.id;
item.src = path.attributes.src;
mugShots[i] = item;
delete item
mugShots.length++;
path = path.nextSibling;
}
trace(mugShots.length)

for (i=0; i<5; i++){
k = Math.floor(Math.random()*total);
_root["item"+i] = mugShots[k].src
_root["id"+i] = mugShots[k].id
trace(_root["item"+i])
trace(_root["id"+i])
}
_root.picture1.jpg_holder1.loadMovie(imagePath+_ro ot["item1"]);
_root.picture1.jpg_holder2.loadMovie(imagePath+_ro ot["item2"]);
_root.picture1.jpg_holder3.loadMovie(imagePath+_ro ot["item3"]);
_root.picture1.jpg_holder4.loadMovie(imagePath+_ro ot["item4"]);

}

myXML.load("http://www.monstermob.com/members.xml")


Thanks

Pick Random Images Without Duplicates
Hi,

I'm trying to write some script that pulls images from an xml file into an array, and then randomly picks out 5 of those images without selecting any duplicates, this is the code i have so far, but i'm not too sure how to tackle the duplicates issue? If anyone could help me out i'd be most grateful


mugShots = new Object();
mugShots.length = 0;

myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success) {

total = myXML.firstChild.childNodes.length;
path = myXML.firstChild.firstChild
imagePath = "http://www.monstermob.com/images/reskin/mugshots/";

for(i=0; i<total; i++){
item = new Object()
item.id = path.attributes.id;
item.src = path.attributes.src;
mugShots[i] = item;
delete item
mugShots.length++;
path = path.nextSibling;
}
trace(mugShots.length)

for (i=0; i<5; i++){
k = Math.floor(Math.random()*total);
_root["item"+i] = mugShots[k].src
_root["id"+i] = mugShots[k].id
trace(_root["item"+i])
trace(_root["id"+i])
}
_root.picture1.jpg_holder1.loadMovie(imagePath+_ro ot["item1"]);
_root.picture1.jpg_holder2.loadMovie(imagePath+_ro ot["item2"]);
_root.picture1.jpg_holder3.loadMovie(imagePath+_ro ot["item3"]);
_root.picture1.jpg_holder4.loadMovie(imagePath+_ro ot["item4"]);

}

myXML.load("http://www.monstermob.com/members.xml")


Thanks

Button Pick Random Mc ? But With Timedelay ?
Im making a litte game and I need some code on a button that when pushed down random choose betwen 3 mc´s. But when you push the button there have to be some time delay before the random choosen mc appear or starts....

is there anyone who knows what code you can put on the button so when pushed wait betwen 5 and 10 sec. (I mean sometimes it starts after 5 sec. and sometimes 7 sec. etc)


I have made the fla file to random choose betwen 3 mc´s,

but how to make the code that makes some timedelay ???

Please ???

How To Pick Random Unique Elements Out Of An Array
I have an array of sprites. I'm using the following code to apply an animation to a randomly chosen sprite in my array:


Code:
var i : int = Math.floor(Math.random() * tempTileArray.length);
var child : Tile = tempTileArray[i];
child.bonusTileEffect();
My question is how do grab more than one random element from my array? I would like to apply my animation to x random sprites in my array.

Appreciate any help you can offer.

Randomly Pick Image.
Hello people, I am looking for a tutorial that will help me figure out how to randomly pick an image,display that image for a time and then fade between that image and the next randomly picked image? Any direction is greatly apprieciated.

How To Pick Color From Image
Hi

I am opening a jpg image in a webpage. I want to click at a point on the image and get the value of the color of that point and display. Can someone please hellp me how I can do it.
Thanks

Need To Pick Your Brains On Image Transparency
HI. I'm not too familiar yet with all the new features of Flash MX, so could I pick your brains on this...

I want to load external images, but ideally, those images should have a transparency (alpha or keycolor).

PNG supports an alpha trans, and GIF supports a key color trans, but unfortunately, externally loaded images can only be in JPEG format.

So the big question: Is there a way to dynamically (via AS) load in a JPEG and then do something like "make WHITE transparent" ????

I'm over simplifying and it sounds like an unrealistic expectation, but perhaps there are some creative solutions.

Keep in mind.. I HAVE to use externally loaded JPEGs (no, I cannot load up SWFs, or anything else!) and I wish to try and make those images' backgrounds go away dynamically.

Thanks
RB

I Can't Pick My Mouse Over Image And Move It Without Moving The Whole Button
ok i have these buttons, that as you mouse over one button a description appears that is in a different spot. Now I did this once and for the life of me I can't figure out how i did it. Now I can't seem to move the second part of my mouse over text and even though I keep attempting to pick a place on my time line, it won't let me only move that object. What am I doing wrong?
Here's a sample of what I have - my client just sent me new japanese text to put in these spots. Hopefully you can help me out

http://www.zoulo.com/japan.html

kaaren001@aol.com

Random Flash N Random Image
Basically I have 5 flash movies and 3 images and I want to show them randomly using dreamweaver.. anybody knows how to do it?

Tween A Random Image To A Set Image
ok

I have a website that is going to have a spinning 'e'
Say that it is currently upside down and backwards...is there any way to have it tween from that point to a set image?

ei:
e <- is rotating on all 3 axises
e <- currently backwards and sideways on the z axis
mouse rolls over a button
the e tweens into another e that is flat (it goes back to normal)

how do i do this??

Random Image, Just Not The Same Image A Second Time.
Does anyone know how to have a random image that does not repeat.

For example if a particular image has loaded once, I dont want this image loading again just because its part of the random feature.

Any samples of this in place would be very helpful.

Thanks

Pick Me, ME, ME, ME
Really need a low down on creating a basic website working on Level. The jpeg images I'm using for background are far to large to have all loading In on one flash movie. So I though it be best to have all the backgrounds load in on Level1.

Bottom line - I'm having a hard time working this baby out!!

this is a link to the way Im doing it which works offline though not online, Preloaders just goes to blank.
http://www.flashkit.com/board/showth...hreadid=504323

...........................
Could you maybe explain how you would create a website on levels, In baby language please

Cheers

How Do You Pick Stuff Up?
i know how to make clicking on my objects add to the score...but how do you get the character to walk over them and pick them up?...if anyone can point me in that direction, i would be insanely grateful....

O.k....i fugured out how to walk over the object and add points to score, now, how do you get that object to dissappear once the score has been added?(i have it so once the points are added the object can't be used again.)

Pick Up Text...?
first sorry my bad bad english.... i hope you understand

i have two mocieclip. first is movieclip (A) where is three static
texts (or dynamic texts?). second is movieclip (B) what is empty.
when user click text, he can pick up text and its come to movieclip B.
is that possible??

Pick A Seat
i'm working with Flash MX 5

i want to make a map where you can pick a seat.
when doing so there has to be a picture on the seat so u know its taken.
also i want to make it if you change your mind and want an other seat u can click the other seat but the first seat has to be clear again (in normal state).


| | | X |
------- ------
^ ^
normal | taken
seat | seat

please can someone help me with this!!
i'm stuck on this all day now!!

Pick It Up And Shake It
Hi, I've got a bit of a problem and was hoping if someone could point me in the right direction with this.

Basically, I'm looking to suss out a good way to pick up objects (all affected by a main gravity that will kepp them grounded), but when you pick up an object rather than the simple stuff I'm trying to get it so that the user can shake an object. By that I mean you can shake it from side to side, up down, any angle and the object will swing with the motion of the mouse.

If you find it hard to visualise what i mean, pretend the mouse is the spring and swinging it will cause the object to move in the direction until it springs back into place when the mouse is still.

Any ideas?

Pick Up Text...?
Hello,
How I do this?
When someone clicks on the text in Movie Clip A, the text in Movie Clip A dissapears from A and appears in Movie Clip B.

Sorry my bad english

Pick Effect
Hello,

Does anyone know how to create an effect where if a person selects one button it becomes highlighted, whereas the others dim, and vise versa?

Thank you...

Pick Up Text...?
Hello,
How I do this?
When someone clicks on the text in Movie Clip A, the text in Movie Clip A dissapears from A and appears in Movie Clip B.

Sorry my bad english

Random, Random Image?
Hi,
Im going through this method for generating a random image into a movie clip

http://www.kirupa.com/forum/showthread.php?t=61320

->macneilslt Thanks by the way

I was just wondering if theres a way to check if say for example image 4 has loaded into the movieClip previously (just before)...and if so....not load that image and randomly pick one of the other images

Thanks in advance

Date To Pick The Month
Hello all,

I have a button that when I click it. It brings me to my callander page. Well I have created he Entire years callander and would like to be able to go to the correct month. How can I use the date function in the action of the button to take me to he right frame.

Old day programe I would say if Month = December then goto 1. else if Month = January then goto 2 else if.....

Anyone hae any clues would be realy helpfull instead of having to changethe calander section on a monthly basis.

Thanks,
Attila GnA

http://server40.hypermart.net/gna/

I Want The Users To Pick Music
how do you control MC that is in a different scene with a button

Button Pick Area
I'm attempting to create a button that will display text when hovered over. The text will be away from the button in an entirely different area of the stage. I can get it to do this easily enough, but it makes the button "pick area" as big as the button and the text box combined. I want the button to only be "pickable" over the button itself.

What I'm doing now is creating a graphic, converting it to a button, then editing the button, inserting the text, and then converting the text to a movie (for fade in). The button works exactly the way I want it to, but it's pickable everywhere within the limits of the button AND the text movie.

Suggestions?

Pick Closer Object
hey.

I just wanna know a simple script to have one object relate to whichever object is closer to it.

In my case, I have a top-down view game, and a robot walks around, picks a random target, and shoots at it. this works fine. but I want to know how to tell the robot to shoot the closer of the targets, assuming the targets are scattered all over the map.

thanks for reading.

Pick Up And Throw A Movieclip
Hi there!
I'm searching for three days now, but I can't find a tut or fla anywhere on the next subject:
I want to pick up a movieclip with the mouse by pressing the mousebutton and start dragging it, but on the release of the button the movie has to move in the direction and with the speed of the mouse at that moment and slow down with friction.
Someone please?????
thnx in advance!

Pick Your Brains Guys
Hi guys, I'm currently trying to find a few examples that i can take apart of a xml loaded simple database in flash. I'm adding on a reviews section to an artists website but haven't worked with xml before. I'm hoping to create a menu that when people click on a particular review it opens so they can read the whole thing. It doesn't need to be too complex but i need to see the actionscript to take it apart.

cheers guys

Combobox To Pick Frame
i want to have a combo-box with different options. Say the options are 1, 2, and 3. If you pick 3 and then press an ok button it will take you to frame 3. The same basic consept for the others.

Pick The Largest Variable
hello all

I need to know how to pick the largest variable out of a list..

im not sure what statements to look for in tutorials or anything so looking for myself is proving hard!

i have these variables and i just need to know how to see whic is the largest and then put that one into a variable

variable3 = curcode[3];
variable4 = curcode[4];
variable5 = curcode[5];
variable6 = curcode[6];
variable7 = curcode[7];
variable8 = curcode[8];
variable9 = curcode[9];
variable10 = curcode[10];
variable11 = curcode[11];

thanks if you can guide me!

How Pick A DisplayObject Color In As3
hi all;
is it possible to get RGB color of a DisplayObject/MovieClip in ActionScript 3.0? how?

Some AS3 Theory, Let Me Pick Your Brains
Hi,

I posted the same question on another forum elsewhere but i'm hoping to cover a little more ground, so I'm hoping you guys will allow me to pick your brains a little with a few questions. I don't need any concrete coding examples, i just want to be pushed in the right direction so that i can figure it out myself and learn in the process since my OOP isn't that great yet.

I built a XML slideshow that loads in text and a voiceover to accompany a photo. Now my boss wants me to extend on this and add several features. Now i find that i went about programming my slideshow poorly.

Features they want added:

Video Support (FLV)
Ken Burns Effect applied to photo's (think slow tweens)
a Control Panel (stop, pause, play, auto play, seek bar)

Now, my question is, how do i go about to program this properly so that they interact with each other properly. As it is now, i made a seekbar component and a music factory component to manage those two parts but i fail to make them communicate with each other properly.

How would you guys structure such an application and make them talk to each other properly?

Color Pick Componenet
hi mates!

I need a color pick component.....where i can download it?

thanks

XML And Fonts--How Does The XML Pick The Font
Hi,

Just wondering how Flash and the XML file know which font to use or how I can change the font style.

Thanks

Ponyack

Some AS3 Theory, Let Me Pick Your Brains.
Hi,

I'm hoping you guys will allow me to pick your brains a little with a few questions. I don't need any concrete coding examples, i just want to be pushed in the right direction so that i can figure it out myself and learn in the process since my OOP isn't that great yet.

I built a XML slideshow that loads in text and a voiceover to accompany a photo. Now my boss wants me to extend on this and add several features. Now i find that i went about programming my slideshow poorly.

Features they want added:

Video Support (FLV)
Ken Burns Effect applied to photo's (think slow tweens)
a Control Panel (stop, pause, play, auto play, seek bar)

Now, my question is, how do i go about to program this properly so that they interact with each other properly. As it is now, i made a seekbar component and a music factory component to manage those two parts but i fail to make them communicate with each other properly.

How would you guys structure such an application and make them talk to each other properly?

Random Image
Anyone know how to display a random image (from 6 possibles) at the end of a fade in tween.

Cheers

Random Image
How can I make a titlebar with random background image-action which would randomly put a picture from various options behind the titlebar when flashfile/page is loaded?

Random Image...HELP PLEASE
Here is my situation:

I have 20 jpeg images which are all the same size. I need to produce a MC which will upload randomly one picture at a time, leave it on the screen for about 3 seconds, then load randomly another image in it's place. This will be an endless loop.

Could anyone help me here?

Email me with an answer if possible. Thanks

if@cogeco.ca

Random Image
Was wondering if anyone could help me out with this... I want to have an action on the first frame of a movie clip that will jump to a random frame / frame label in the same clip. There will be images or movie clips on those frames. Thanks.

-S

Random Image
Can someone please tell me how I get random image i Flash 5?
I have 4 different pictures that I want to use as background images in my flash movie. And every time the flash movies loades I want one of those pictures to load in random order.

Please help me

Copyright © 2005-08 www.BigResource.com, All rights reserved