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




Random Questions



I have made a quiz which has 20 questions. 15 questions are asked at random. However, being at random some questions are repeated. How do I shuffle questions rather than use random? Any help appreciated



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-13-2004, 06:05 AM


View Complete Forum Thread with Replies

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

Random Questions How?
i saw this game and in that say there were 100 question
some did repeat but they were like coming in random ...how is that done?'
thanks for the help
cheers,

Random Questions
I currently have a txt file that has 18 questions and 18 answers (e.g. &quest1=something &answ1=somethingelse) I was wondering is there a way to create one text box and have it randomly use a question and then be able to get the correct answer.

Some Random Questions
This goes to everyone out there

I was thinking about making a function (or a set of functions) that would allow me to preload not the whole movie, but a set of objects that I desire. Is it possible to know how many bytes an object has? Ie. knowing how big is a single movie clip.

This would ease my task because I would include an actionscript file and then add all the objects i wanna load (with or without streamming) and my preloader function would tell the movie if it is ready to be played according to the speed it is being loaded or not.

I will also release this if I can do it.

So, can anyone out there please answer these "simple" questions to me, as I am new to actionscript (not programming)

Thanks in advance

A Few Random Questions
1. How do I make a textbox that I can type words into while the movie is playing? Everyone seems to know how to do it but me...

2. I'm no artist, and I can't figure out how to make a movie seem like the viewer is going forward. I can make make it look like you're looking side to side, but making it look like you're going forward is the tricky part.


3. I'm having trouble searching the threads and finding anything I want. How can I be specific enough to find what i'm looking for but wide enough to find anything at all? (Just looking for advice in using the right keywords)


These should be pretty easy to answer. At least I hope so.

--Thanks in advance!

Random Questions
I have made a quiz which has 20 questions. 15 questions are asked at random. However, being at random some questions are repeated. How do I shuffle questions rather than use random? Any help appreciated

5 Questions Chosen At Random Which Have To Be Different
here's my problem: I need to choose 5 questions out of ten at random, the same question cannot come up twice in the serie of five,the questions are sitting on ten frames of a movieclip, 5 instances of that movieclip are on my page. effectively, I set up five random numbers wich will determinate on which frame each of my movie will stop.
I need to check for each random numbers if it is different of the other ones, otherwise i'll set a new random number.
For that, I set up a loop for each random numbers.

Goes like that to check, for example, the random number 4 agaist the others:

loop = 0;
Qnum = 5; //number of questions random numbers
while (loop <= Qnum) {
if (Number(RandomQ4) == Number(RandomQ add loop) and loop != 4) { //obviously Q4==Q4
RandomQ4 = RandomQ4 +1; // add one
prevFrame (); // go back and run the loop to check the new Q4
loop = loop +1;
}
}

I run this loop for every random numbers

I tryed with Number, with eval and without anything and nothing runs, any idea?

If you feel up for it, I can send you the fla...
my email: bastien.francois@eurorscg.co.uk
A pint if you crack it! (London)
cheers!

Help With Random Answers To Questions
Hi Folks,

I haven't done this type of scripting before but one of my clients wants to have an 8-Ball feature where a user types in a random question and a random answer is provided. Basically it would have one empty box where the question is typed in, and it can be ANYTHING typed in there and then when the button is clicked to ask the question, a random answer is selected from a set of answers typed in there.

How do I do this?.. Sorry for the vague question but I haven't done this type of a feature before so I need help even getting started.

Filip

Generate Random Questions
Hi. I'm making a flash quiz on Flash MX 2004 and was wondering how to make flash generate the questions randomly. Could anyone help me? Thanks.

[CS3] Help Picking Random Questions
Hi all,
Hope someone can help me out here, I think this should be failrly easy to someone who knows what he's doing
I've made a trivia game which has a pool of a 100 questions, but each game played needs to randomaly choose 33 of them. A player has the option to play again after he finishes a round of 33 question and they need to be randomaly chosen again. I thought of using an array to randomaly compose a list of 33 numbers at the beginning of each round and then use it as a guide to which question number to go next, because I need to check no question is asked more than once in the same round.
Can anybody help me with it, or have a better idea?

Thanks!

Random FLV Player Questions?
So I am really new to actionscript but I been working on trying to put together a random FLV player. I have 4 flvs that I am going to randomize through. I was going to use the FLVPlayback component. I can figure out how to set a action that will load from my source. I found this

public function set source(value:String):void

but I am not sure where I should state my instance named "video" which is the FLVplayback component as well where I should state my source. I know I will have to make a array that will go through my four videos. I just need a little help on how to get started. Thanks

Creating Random Questions
hi...i am using attachMovie to download random questions for my quiz. there are 4 questions. any 2 random questions are played. the same questions cannot be played.

i tried to use arrays and randomizer to create random questions but cannot understand the script..

Random FLV Player Questions
So I am really new to actionscript but I been working on trying to put together a random FLV player. I have 4 flvs that I am going to randomize through. I was going to use the FLVPlayback component. I can figure out how to set a action that will load from my source. I found this

public function set source(value:String):void

but I am not sure where I should state my instance named "video" which is the FLVplayback component as well where I should state my source. I know I will have to make a array that will go through my four videos. I just need a little help on how to get started. Thanks

Random Questions - FLA's Included
I thought I had this licked... I have a quiz that randomly picks (imports) questions from a pool of 30 small swf files. The randomization is the part I get. The part I can't get is how to avoid running the same question more than once.

I've included the fla files and everything that it required to run this test here (only 1.6 MB)....
HTML Code:
<a href="http://ca.geocities.com/aaronbernardo@rogers.com/uploads/contest.ZIP">HERE</a>

I'm learning as much actionscript as I can and I've tried looking for tutorials on this but I find that most of my questions in actionscript are too specific to find in tutorials. Am I wrong?

Thanks in advance.

Random Questions - FLA's Included
I thought I had this licked... I have a quiz that randomly picks (imports) questions from a pool of 30 small swf files. The randomization is the part I get. The part I can't get is how to avoid running the same question more than once.

I've included the fla files and everything that it required to run this test here (only 1.6 MB)....
HTML Code:
<a href="http://ca.geocities.com/aaronbernardo@rogers.com/uploads/contest.ZIP">HERE</a>

I'm learning as much actionscript as I can and I've tried looking for tutorials on this but I find that most of my questions in actionscript are too specific to find in tutorials. Am I wrong?

Thanks in advance.

Random Questions In FLash
Good day everyone, can somebody here give me tips on how to create random questions in FLash Actionscript..thank you

Quiz With Random Questions
I am a Flash newbie. Using one of the Flash MX 2004 quiz templates, I have created a quiz that has 100 questions. I want my final product to randomly choose 20 of those questions at a time. If the user scores a 90% or above on those 20 questions then a message will come up saying that the user has successfully completed the quiz. If the user does not score a 90%, then a different message will come up and the user will need to go through 20 more randomly chosen questions. Any thoughts on the best way to set this up? Is it possible to set all of this up within the current .fla, or should I start a new .fla that will somehow randomly pull the questions out? Help!

Creating Random Questions
Hi. I am using attachMovie to download random movie clips which consist of questions. There are 4 questions. 2 random questions will be played. The questions cannot be repeat.

I tried to apply arrays and randomizer but i got lost.

help will be appreciated. :-)















Attached Files

Generate Random Questions
Hi. I'm making a flash quiz on Flash MX 2004 and was wondering how to make flash generate the questions randomly. Could anyone help me? Thanks.

Random Terain Generator Questions
I'm currently working on a randomized terrain generator...

basicly its an 8x8 grid,
I have 2 images I want to use, water and rough
I making a button named randomizer that when you click it, it starts to make the randomized terrain. So I want it to randomly fill the 8x8 grid with these images till it is full then stop. Problem is I don't know how to even start with the scripting. So basicly I need someone who will work with me and help me put this together...I'd greatly appreciate it.

Thx for having such a great board

-Matt
[Edited by Ratznests on 08-09-2002 at 12:58 AM]

Quiz-tutorial, Random Questions?
Isn't there any tutorials teaching you how to build a quiz giving random questions (from external txt-file)??? I found loads of quiz's under "movies" but i don't really understand any of them!
I wanna bulid a quiz given you only the opportunity to answer yes or no and afterwards giving the correct answer. If possible giving one answer if you are right, another if you are wrong.
Can anyone help so a newbie understand??? :-)

Please.........

Quiz-tutorial, Random Questions? (mx)
Isn't there any tutorials teaching you how to build a quiz giving random questions (from external txt-file)??? I found loads of quiz's under "movies" but i don't really understand any of them!
I wanna bulid a quiz given you only the opportunity to answer yes or no and afterwards giving the correct answer. If possible giving one answer if you are right, another if you are wrong.
Can anyone help so a newbie understand??? :-)

Please.........

Flash Quiz Random Questions
hi guys,

i have made a quiz from various tutorials,using version mx and xml file for the questions. I now want to randomize the questions and answers, any ideas would be a greate help. the xml files goes as below
<items>
<item>
<question>what color is the sky?question>
<answer correct="y">blue</answer>
<answer>red</answer>
<answer>yellow</answer>
<answer>cyan</answer>
</item>
and here is the action script

How To Generate Random Questions For A Game?
HI... i'm trying to make a "Who wants to be millionaire" flash game. but the questions are allways the same and in the same order. I had an idea: let Actionscript choose 1 question out of 100... so the question DONT repeat.
But the problem is: I dont know how to generate random questions... i just know how to generate random Numbers. plz help

Questions (Random Image Display)
Hi There,
first of im absolutly new to AS so Take it easy and slow Please.

Im Trying to Build a Game. So Far so good. The Deal is that i need to echo the results of each round to php script to insert them in to a DB/ get the info out of the DB. That part isnt to much of a problem. The Problem is i need to display a random image every time a action (button is pressed) occurs. And the result (image thatt is displayed or the id of it) gets handed to php to get the results. Ive got it working so far that the swf/fla selects a random image and gives the id to the php script the problem is it wont display the image.
How do i get AS to show me the image in a the mc where it selected the random image and traced the id?? so far i got this:


PHP Code:



myImages = ['Herz2.gif', 'Herz3.gif', 'Herz4.gif', 'Herz5.gif', 'Herz6.gif', 'Herz7.gif', 'Herz8.gif', 'Herz9.gif', 'HerzZehn.gif', 'HerzBube.gif', 'HerzDame.gif', 'HerzKoenug.gif', 'HerzAs.gif'];
function extractImage(array) {
    image = Math.round(Math.random()*(array.length-1));
}
extractImage(myImages);
trace(image); 




Thx for any help you guys can give me

Xml Flash Quiz Random Questions
hi guys, im pretty new to flash so please bare with me!!
i have made a quiz from mixing and matching from various tutorials of the internet, and now want to make the questions(multiple choice) and possibly the answers appear shuffled. the xml looks like this
<quiz>
<title>Quiz</title>
<items>
<item>
<question>In which continent is the country Japan located?</question>
<answer correct="y">Asia</answer>
<answer>Europe</answer>
<answer>Africa</answer>
<answer>America</answer>
</item>
and here is what ive got so far with the action script!
thanks alot in advance, and any help will be much appreciated!!!

Random Generation & RemoveMovieClip(); Questions
I am trying out some actionscript and just learnt how to use hitTests.

First off I wanted to know how to make it so that when

instance you collides with instance small, instance you grows by 10 width and height and insance small disappears. Instace you already follows the mouse so it can collide with small like that.

With alittle help from a friend I got a true hitTesting code.

Here is the code I tried on small to make it dissappear. Theres no output errors but nothing happens on collision. Nothing.


ActionScript Code:
onClipEvent(load){xcorrect=(_root.you._width/2);ycorrect=(_root.you._height/2);}onClipEvent(enterFrame){if (this.hitTest(_root.you._x,_root.you._y-ycorrect,true)==true){_root.you.width = _root.you.width + 10;_root.you.height = _root.you.height + 10;_root.small.visible = false;}}


Secondly random generation. I have a movieclip with the instance shape. Shape will randomly generate off screen and float about alittle on screen before drifting off at about 3pps, when shape gets so far off screen he will hit an invisible barrier and dissappear into nothingness. But I don't know how to generate shape. Also I want more than one of shapes family to join in so I want to randomly generate his cousins too that are also called shape. They have the same properties.

Like my little story?

Seriously I need help with this...

Making A Quiz With Random Questions
Can some one point me in the direction of a tutorial or example of a quiz that spits out random questions and then removes those that have been asked from the array or list or whatever it is going to be...
Thanks!
Nate

Pls HELP ASAP Can You Do Random Questions In Slide Presentation?
I have a series of questions in my flash program I was wondering if it is possible to select only say 10 of them (I have about 50)...i want them to be randomised so that a user never has the same question twice and that a final result can be given based on the 10. I am fairly new to flash so would love a basic explanation. I have used a slide presentation template.

In my program I have a number of slides, as the slides progress the image doesnt change but the questions do...what i wanted to be able to do was to have different questions and images in the quiz but have a question bank of about 50. Is it possible...would be grateful for a swift reply
have a slide presentation which involves teaching medical students how to read CT anatomy, now this involves a diagram with a number of structures on it, basically i created a tutorial which allows the user the click on each structure to reveal its name...this involved creating movie clips which acted as buttons etc

I then wanted to create a quiz, which i did, which involved the same diagrams but the user had to identify the structure by clicking on the hotspots, these diagrams are on individual slides and the diagrams are different throughout, some are the same as well but the user has to identify different structures. this is all created using a slide presentation template, what i wanted to do was rather than have 50 or 100 odd questions...i wanted to give the user 20 questions from a random selection...is there any way of applying the code so that it selects slides? does this make sense? I can email the file so that you can see what i am talking about if that helps

Would be grateful for your help
NB

How Do I Keep Track Of Which Questions Were Answered Correctly If They Were Random?
I am building a questionnaire and now client wants a detailed results screen at the end that will not only show how many answers were good but WHICH ONES were answered properly. So far, I have a var that increments whenever the user answers correcly. However, I have no clue how to keep track of which questions were answered properly so that at the end I can tell the user which ones he/she got correct.

Can anyone please help?

Problems With Loading Random Questions At Times
i have created random quiz that plays 5 random questions......There are a total of 8 questions...I use attachMovieClip to play questions.

Therefore I linked the questions.....The instance name of 1st qn is 1, 2nd question is 2 and so...

However when play the quiz, it dun load some questions at times...Sometimes 5 random questions are loaded...sometimes only 4 random questions are loaded...What's wrong with the code?



var n:Number = 7; //number of questions - 1
var totalCorrect = 0;
var arr:Array = [1, 2, 3, 4, 5, 6, 7, 8];//random array, in your case an array of questions
var selector:Number = randRange(0, n);//pick a random number between 0 and 9
var chosenQuestion:Array = new Array();//stores randomized chosen numbers
var i:Number = 0;//iteration
chosenQuestion[i] = selector;//first stored randomized number goes in chosenQuestion array
_root.attachMovie("next", "next", this.getNextHighestDepth(),{_x:900, _y:500});


//attach first question with instance name 'q1'

//return values is taken into a variable and later that return value is used as a parameter to remove that clip...it holds the object of newely created movie clip......
myCurrentQuesObj = _root.attachMovie(chosenQuestion[i],"q"+i,_root.getNextHighestDepth(),{_x:50, _y:100});
i++;

//next Button functionality
_root.next.onPress = function()
{
if(i<5)
{
pickRandomNumbers();

}if(i==5)
{
_root.next.removeMovieClip();

gotoAndPlay(2);

}


}


function gamePlay() {
if (i<5) {
pickRandomNumbers();
} else {
delete this.onEnterFrame;
trace(chosenQuestion);

}
};

function pickRandomNumbers() {
while (checkIfChosen(selector, chosenQuestion)) {
selector = randRange(0, n);
}
chosenQuestion[i] = selector;
removeMovieClip(myCurrentQuesObj);

//return values is taken into a variable and later that return value is used as a parameter to remove that clip...it holds the object of newely created movie clip......

_global.currMovie="q"+i;
myCurrentQuesObj = _root.attachMovie(chosenQuestion[i],"q"+i,_root.getNextHighestDepth(),{_x:50, _y:100});
i++;
}

function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.round(Math.random()*(max-min+1)+(min-.5));
return randomNum;
}

function checkIfChosen(aNumber:Number, arr:Array):Boolean {
for (counter=0; counter<arr.length; counter++) {
if (aNumber == arr[counter]) {
return true;
}
}
}

Random Position And Scale. Couple Of Questions
Hi, I want to know some things about randomness in flash from begining...

Here are my questions...

1. How to make random position (scale) ?

2. How to make so that my rectanlge will be positioned randomly, but inside some margins (I mean that if a rectanlge will be positioned randomly, it could be half visible, half of it could be out of window...)

3. For example if I'm using Cycles, and I inside of for () {}; will be random position (scale), how can I get the result of this random positon (For example I need to name it with its X and Y coordinates - something like X:234 and Y:654)

There was something else, but I can't remember atm...

Thanks in advance for your help...

Multiple Questions Concerning Random Numbers, Loading JPEGs, Etc.
Hi All,

I have made a flash movie as seen at http://www.coffeemamma.com.au and would
like to change the following:

I'd like to generate three random numbers from 1 to 5 inclusive but I want
to ensure that each number is different - e.g. 2, 4, 1 (not 2, 4, 2). I know
how to generate ONE random number, but I'm stuck on comparing them to see
whether they are the same (and if they are, then generate new numbers until
they are unique).

With the three numbers I would like to load images based on those numbers -
e.g. '_image_2.jpg' then '_image_4.jpg' then '_image_1.jpg'. This part is
fine IF I can generate the numbers.

I'd also like to have the images come to the front when they are hovered
over with the mouse and then to go 'back' to their original position when
the mouse moves away. This I'm completely stuck on.

I'd also like to be able to put the newly loaded images into certain
positions (as per the example) rather than only loaded to (0,0) coordinates.

I also want to be able to have the images masked as they come in (as per the
example) in order to avoid white corners on the top images.

I also have a page as per http://www.wasabi.org.au/wodonga.shtml which has
some of the functions I want to use, but I can't seem to get some of the
functions working in my new movie...



Many thanks,

Bruce

Hey, Questions About MC's With Diff Buttons Doing Same Thing? - And Some Random Snow?
OK, I have a movie I'm making for a website - and I have some problems with it, take a look at it - I attached it, as you can see each movie clip has a slider and a play and stop button - the slider is linked to the volume, and the size of the head in the middle is linked to the volume. How would I make each slider change the volume ? (actually I would like to link the slider to track progress, and then link the size of the head to track progress,) but i'm kindof confused as to what to do

Also! the notes in the back are too much, and i was wondering if i could get them to go behind the MC's, also, I was wondering if I could get them to only spawn on the music bars, and not in the middle.

Whoever helps with this -- it is greatly appreciated, I've been stumped for weeks.

Thanks
Wyatt

-ps. sorry the clip doesn't have music yet, it is still in its early stages.

Several Questions About (random) Sound (in Actionscript), Linkage And Some Sort Of Pu
I have to design a game for a school project that I have to redo to pass my year, but so far I have encountered several problems. My game is for children from 6 to 8 years old, so the game has to have a lot of sound (voice recordings) to explain the menu’s and the stuff they have to do.



1. Sound as rollover on a button

The problem is not that it doesn’t work, but that it only works once. If you move your mouse cursor over the buttons the first time, it will play the sounds. But if you move over them a second time, it doesn’t work anymore. You have to reload to make it work again.



Used code:

* on an actions layer:


Quote:




//copyright August 2002 by Kenny Bellew - kennybellew@hotmail.com

this.onEnterFrame = function () {

if (playing==true) {

myPlay="Playing"

}

else {myPlay="Not Playing"

}

if (playing02==true) {

myPlay02="Playing"

}

else {myPlay02="Not Playing"

}

}








- * on the layer with the buttons:



Quote:




this.kapitein.onRelease = function() {

getURL("scene2.html");

}



this.help.onRelease = function() {

getURL("scene3.html");

}



firstSound = new Sound();

firstSound.attachSound("zin1");

var secondOffset = 0;

var loops = 0;

var playing = false;



secondSound = new Sound();

secondSound.attachSound("klikhier");

var secondOffset = 0;

var loops = 0;

var playing = false;










* on the buttons:





Quote:




on(rollOver) {

if (playing!=true) {

playing=true;

firstSound.start(secondOffset,loops);}

}








So, the question is, does anyone know how I can make the sounds play on a rollover action everytime you move over the buttons?

http://cmdstud.khlim.be/~ejansen/Cre...gn/scene1.html


2. Random sounds

One of the characters in the game is a parrot. I would like to have it yell out some things randomly. And at the same time, the parrot should move its beak.I know I have to use an array for the random sounds generation, but I don’t know exactly how and how do I make the beak move when one of the sounds plays?


3. Linkage

I have 7 scenes in the demo version of my game. I have read that it’s not a sensible thing to do to make one file with all those scenes, besides that, I have tried it before with only 2 or 3 scenes and I got in trouble with linking.
So now I’ve made 7 swf files and linked them to each other by using the getURL action, but that links to the html files, and I would like to play everything with the flash player. If I link to the separate swf’s than it opens a new player with that file and I’ll have 7 different things open.

So, is there another way to play the game without putting the 7 scenes in one swf?


4. Puzzle

I have designed a counting table where the kids have to ‘fill in’ numbers. So they make the sum, and they have to drag a number in a gray box, to the empty box in the table. So that’s probably done with drag and drop target? But what if they want to put the wrong number in the box? How can I specify that?


http://cmdstud.khlim.be/~ejansen/Cre...ign/scene5.swf (this is what that scene looks like)

Hey, Questions About MC's With Diff Buttons Doing Same Thing? - And Some Random Snow?
OK, I have a movie I'm making for a website - and I have some problems with it, take a look at it - I attached it, as you can see each movie clip has a slider and a play and stop button - the slider is linked to the volume, and the size of the head in the middle is linked to the volume. How would I make each slider change the volume ? (actually I would like to link the slider to track progress, and then link the size of the head to track progress,) but i'm kindof confused as to what to do

Also! the notes in the back are too much, and i was wondering if i could get them to go behind the MC's, also, I was wondering if I could get them to only spawn on the music bars, and not in the middle.

Whoever helps with this -- it is greatly appreciated, I've been stumped for weeks.

Thanks
Wyatt

-ps. sorry the clip doesn't have music yet, it is still in its early stages.

Questions About Random Character Movement And Hit Detection For Game [renamed]
Hey every one i was thinking of making a new game where there are rebel smiley men( because i love smileys) and you just kill them and get as high a score as you can.

What i need to know is how i can make them have random movement.
Not just normal random movment but when it decides to walk up it will change to a different frame within the rebel and make it face the direction of its movment.

i also ened to know if when a mc moves into a invisable barrier or the rebels sight that it will try and kill the mc.

Thanks in advance

(*)Questions About "random( )"
I have some questions about random( ):

QUESTION 1
-------------------
if I say
random(2);
will the possibilities only be 0, 1 and 2? or are they also 1.0000001, or 2.00435, and so on?

Are random values integers or not? if not, how do i make them integers?

Can I say, for example,
random (int(2));
???

QUESTION 2
-------------------
Can I somehow use random( ) to chooe either between a vriable A or a variable B?

QUESTION 3
-------------------
How do I tell the playhead to do this in ActionScript:
Go to a random frame between frame (for example)3 and 7?
will the values be integers, so the playhead won't go looking for frane 4.50236 (for example)?

Hope you can concisely help...
Please reply soon...

XML Quiz - Randomizing Questions & Level Of Difficulty Questions
Hi Folks,
I've been tasked to do a quiz in XML with a few caveats and I need some help.

The quiz needs to pull randomized questions from the XML file and also I need to have this sort from 3 levels of difficulty. For example, a user would possibly get fed 3 easy 3 medium or 4 hard questions.

My XML is set up as follows:
<QUIZ>
<QUESTION TEXT="Harry Markowitz won the Nobel Prize in Economics for a paper on portfolio diversification that he wrote while..." ANSWER="2">
<CHOICE>A. on the faculty at Columbia</CHOICE>
<CHOICE>B. a grad student at Chicago</CHOICE>
<CHOICE>C. a janitor at MIT</CHOICE>
<CHOICE>D. a patent clerk in Hamburg</CHOICE>
</QUESTION>
</QUIZ>

These questions are being stored in an array called questionsArray. So I guess all I need to do is call these from the array @ random, but the level thing is really kickin' my butt. Im just kind of lost on this one and I was hoping for some insight all the way around on this. For some reason XML in Flash scares me. It always ends up being nightmare. Someone please wake me up from the nightmare:-

Thanks,
Michael

Random Random Random Timer... Problems
Heyy guys. I know you guys know this stuff backwards & forwards so maybe you can help.

This is a 2 part problem. Part 1 is Im trying to create a timer that functions at random intervals, the function in this case is playing a MC of a car driving on a freeway in 1 to 10 second intervals to give the feeling of, well, randomness. (I've attatched the .fla file if that'll help).

So it works, but not quite as it will generate intervals only twice before it repeats the second interval over and over. So the car will 'drive' in say, 7 seconds the first time and then it will drive in 3 seconds, then again in 3, and in 3 and in 3 seconds. Ive tested it so much I know its not coinsidence.

Here's the code Im using (located in the freeway MC):

var interval:Number = random(10)+1;
function someCodeToRun() {
_root.freeway.diffcars.drive01.gotoAndPlay(2);
}
setInterval(this, "someCodeToRun", interval*1000);

Part 2 is I also wanted the cars to be different colors, which is why there is a diffcars MC with different frames of cars, but now Im not even sure I was headed in the right direction with that.

Ultimately Id love to have different colored cars driving on the freeway at different intervals. Can anyone figure this out?

Few Questions Projector Questions
I'm making a projector file for use on a CD, and have a few questions--

I'd like to make an exit button that closes the projector-Possible? If so, basic way to do it?

I'd also like to run a bat file on exit (if the whole exit/close thing is possible that is), and know that the fscommand exec has to be used, but can you have an "do this and then close the projector" sort of command on a button?

Last thing-Right now it says Flash Projector at the top of the window-Can this be changed with some autoscript, and if so, how?

I've gone through the tuts (or most of them) and can't find answers to this stuff, so any help would be appreciated--

3 Sound Questions; 2 Other Questions
1.Okay, say you're using an event sound, and you want it to fade out after it reaches a certain point or if you press a button. How do you do it?
The thing that I'm going for is using an event sound that plays as you read text. You can press a button to continue reading the text. I also want the song to loop a couple times, just incase it takes the reader a while to read it all. Then, when you press the last button, the music fades out. How do you do that? I would just make the music cut off, but that would be too choppy.

2. How do you cut out a part of the song? For example: You want the long intro cut out, and the main chorus to play.

(note I have a Mac)
3. I have heard you can convert wav files to MP3 files by using a CD ripper. I used a CD ripper, but it wouldn't import the .wav file. I found other files, but they're either for Window users or shareware. Does anybody have a link to a Mac CD ripper that can convert them that's freeware, or do I just have to pay?

(non-sound questions)
4. I go to a website where they allow you to submit flash cartoons you have made in .SWF format. However, there is no download sign. How do I download it? I have been told how, but it was by a Windows user, and he told me of different options. How do I download it?

5. I'm just curious, but is it possible to import another person's .swf file? I'm just wondering, because one guy said "The sound effects I used were ripped from someone else's flash file".

Thanx for your time.

Questions Question Questions :)
I just have tons of questions :P ... learning is a good acivaty... ok to the question i have... How could one make a gradient move... i want it to follow a object that passes by... i want to do it in code... i have been assumeing that a heavily coded flash site is smaller than a site with more tweens... is that right? i can work in flash but i'm foggy on the details of the program... i have many more questions and need answers...

What is wanted:
I want to create shapes, such as triangles and squares, that are actually made up of small (maybe 5X5 pixel) squares which will make up a "pseudo" gradient mesh (to save on processor load). The end result is to create shapes that simulate light reflecting off a 3D shape and have that light source respond to the mouse cursor.

So imagine a red triangle with the light source being the mouse (or an mc), as the mouse moves, the small squares of different lightness move to simulate the reflection.

Perhaps there is an easier scripted way to do this, that kooky subQuark suggested this wording!

Any help would be appreciated.



thanks ... laters Jimmysomebob

PLEASE HELP - URGENT Load Random Swfs From Individual Random Sets
I have two target mcs I would like to load different random swfs into

I have eight folders (a-h), each with 12 swfs (001-012)

I need to load a random swf (001-012) from a random folder (a-h) into the "card1" mc

I have figured out how to specify which one I want:

loadMovie("a/a001.swf","card1")
stop();

however, I need it randomized....

then, I need to load another random swf into my "card2" mc (001-012) from another random folder (a-h, ...except for the folder from which the first swf was loaded)

can somebody please help??????

Random Movie Clips To Play For Random Amount Of Time
hi,
i am loading external movieclips randomly into 4 seperate emptymovies, i now need a way to get these random clips that i am loading to play for a random amount of time and then load the next clip.
i need some help with the code...

how do i get the clips to loop, then assign each a random number and have flash check if the random num is = to current frame...if it is, have that clip stop and a new one load?

i have no idea how to write the code for this
any help would be great

thanks

this is what i was given so far..but don't know what to do with it.

Code:
var rnd = Math.round(Math.random(mc._totalframes));
mc.onEnterFrame = function() {
this._currentframe >= this._parent.rnd ? unloadMovie(this) : null;
}

Script Needed: Random Picture On Random Place By Click
I have a small question about a script I'm trying to find. I don't have a lot of experience with Flash, but I have to do this thing for school for which I need this script for my website.
I need a script which does the following: When you click on a button (or just on any place if the first is not possible) with you mouse, there appears a random picture (one out of ten or something) on a random place in a field (so not the whole page).
I hope you understand what I mean. I don't know the script, I only know that it's supposed to exist :) Does anybody know this script or where I can find such a script?

Thanks for helping me!

Elfie

Help: Multipule Random Positioned Duplicate Random Movie
Does anyone know a way that i can produce a button that when rolled over will duplicate x amount of movies each with random _x and _y positions? Basically i have a movieclip that will
gotoandPlay(math.Round((math.Random()*10)+1)
which randomises that frame that is played. This instance will then do some form of tweening and then gotoandPlay(1) again. I need a script that will then keep generating more duplicate movie clips whilst a button is moused over. i tried the following

on(mouseover){
i = 0;
rand_num = math.Round((math.Random()*29)+1);
while(i<20) {
duplicateMovieClip(_root.movie, "movie"+i,i);
setProperty("movie"+i, _x, _root.movie._x+(rand_num*5);
setProperty("movie"+i, _y, _root.movie._y+(rand_num*5);
i++
}
}

where movie = movieclip name

but this seems to generate all the clips on top of each other @ different depths. I want movies that are all in different positions. Can you help?

Random Movieclip @ A Random Partly Defined Position
Ok I´ve searched this forum to death but i didn´t REALLY
find the answer to my question! I think it can´t be that
difficult but i´m new to action-script and so i gotta hope
u´ll know the answer :

I´ve got an movie. (uh yeah ^^) in this movie there are
many movieclips that contain animations. now i want these
mcs to appear randomly @ a random position of a few defined
positions.

I really got NO idea how to do this !*prayinforyahelp*

ok thx 8]

Detecting Which Random AttachMovie Loaded From Random Array
I'm building a Freecell type card game. I've got an array that loads all of the cards (actually, the linkage names for each card loaded from the library with attachMovie). I randomize the array before I "deal the cards" onto the stage.

Here's a little code snipet where "deal" starts off equaling 0 and "cardDeck" is the value from my array (for example, c5 equals 5 of Clubs):


Code:
if (deal<52) {
_root.createEmptyMovieClip("card"+deal, deal);
_root["card" + deal].attachMovie(cardDeck[deal],cardDeck[deal],deal);
deal++
}
There's more, of course. My problem is - How can I detect which card loaded into which movie? For example, I know I have a movie called _root.card6 at the bottom of the first column, how can I know what card is loaded into _root.card6?

Movieclip Showen In Random Places At Random Time
How can I make my movieclip appeare in diffirent places at diffirent time? And the movie clip is this flying mobilephones(you can see it in swf http://www.hot.ee/at03/flying-mobs.swf).

Thanx in advance!

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