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








Random Function Selection


hello,

I am trying to get a random MC to play every 15 seconds. Using setInterval.

Here is my code >
What seems to be incorrect is that the setInterval doesnt seem to be collecting the function which starts the MC.

function car1(){
car_mc._x = 1130;
car_mc.tween("_x",-300,4,"easeinSine");
}
function car2(){
car_mc._x = 1130;
car_mc.tween("_x",-400,4,"easeoutSine");
}
function automob(){
var ran:Number = Math.ceil(Math.random()*2);
car[ran]();
trace (ran);
trace (car[ran]);
}
setInterval(automob,15000);




KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 08-07-2007, 09:54 AM


View Complete Forum Thread with Replies

Sponsored Links:

Sequential Selection Vs Random Button Selection
I am missing something here. I have several buttons associated with several movies. When the buttons are selected in sequential order they play the appropriate movies

When the buttons are selected out of order (in random fashion) the selected movie does not play.

Any solution is appreciated

Code snippet follows:

//When button1 is selected bluemovie plays and then when button2 is selected pinkmovie plays
// However if button2 is selected before button1 pinkmovie does not play.


button1.addEventListener(MouseEvent.MOUSE_DOWN,sta rtClip1);
function startClip1(event:MouseEvent):void{


bluemovie.play();



button2.addEventListener(MouseEvent.MOUSE_DOWN,sta rtClip2);
function startClip2(event:MouseEvent):void{

pinkmovie.play();

}
}

View Replies !    View Related
Random Mc Selection
My actionscripting skill are terrible! Pls help....

I think this should be a fairly simple bit of code, but when it comes to 'random' I get v confused.

Basic idea:
Create a 'quote's ticker' which draws in random quotes and scrolls each upwards accross the stage.
*This is not drawing in text from an external file.*
The 'quotes' are simply saved as mc's in the library name news01, news02 etc. Each mc also has been exported for actionscript with suitable identifiers ('news01_mc', etc).

Each of the 'quotes' mc's are drawn into another mc called quotesTicker_mc.

Is there any way of randomly drawing into this clip one of the 12 quotes mc's, have it scroll up the page, then (once vanished off the top) the ticker_mc loops back to the beginning and grabs another random quote and starts all over again??

If there is a tutorial I have missed which I could draw some actionscript from I would very much appreciate a point in the right direction. I have searched a few sites as well as this and have come up with nowt suitable.

Thanks...

View Replies !    View Related
Random Selection
Hello;
I'm creating a quize but I have a problem.
I have 10 MCs in the Library (I didn't put them on the stage) and tree main MC in the Stage .. I want to select three MCs from those 10 MCs randomly and attach them to the main three MCs on the stage randomly too.

so I have to do two random select :
1- when I select from the library .
2- when I attach the selected three MCs to the stage.

Anyone can help me with this Please .

View Replies !    View Related
Random Selection
Hi guys

How can i place a script that would choose different symbols or mc's by random, eg i load a frame and it chooses one mc out of ten by random selection, how can this be done?

View Replies !    View Related
Random Selection
Hi All
There are times when you just cannot find the solution, and I have tried so please can anybody help me with some coding.

My new project is to produce a football cup draw in flash starting with 80 teams in Round 1, then 40 teams in Round 2 leaving 20 teams to join another 44 teams in Round 3, Round 4 32, Round 5 16, Round 6 8, Semi-Final 4, and Final with 2.

N0 of teams 124, when Round 1 is played a random number is attached to each team thus leaving a winner to go forward into Round 2. In the event of a tie them teams will a recieve a furthur random number attached untill there is a winner. And so on until there are just 2 teams in the final that will eventually produce a winner. Hope I am making sense.

What I need is a random selection code that will place each draw in two text fiekds. I have used
<code>var randomPick:Number = Math.round(Math.random()*80);</code>
and used a trace to output a number which works but I need to get these number (teams) into text fields.
Can I use XML data?

I use Flash 8 AS2 or 3.

Any help to start me off would be much appreciated.
Bern

View Replies !    View Related
Random Selection Of A Frame In A MC?
Hey y'all, is it possible to take a MC with 100 frames, each w/ a stop action, and have it goto a random frame number each time that mc is loaded? Have no idea how to do this, but I'm pretty sure it's possible.

Thanks

xissue

View Replies !    View Related
Random Scene Selection
I am currently making a flash file which needs to randomly jump to one of 3 scenes

basically scene 1 is played and then must goto either scene 2,3 or 4 randomly

I was wondering if this is possible with some actionscript ?

Thanks in advance
welly

View Replies !    View Related
Random Scene Selection
Hi Guys and Gals,

Is it possible to have a movie once it reaches the end of scene one to randomly play any of the other scenes that are in the movie?

This is driving me mad, I tried a random array in the gottoandplay(randomscene, 1) but the error says it must be contained in quotes.

TIA
Arakis

View Replies !    View Related
Random Selection Of Pictures ?
ok i have a movie clip made up of 5 frames in total, on each frame there is a diffrent image, now how can i randomly show the images in a constant random order rather than the clip play like.... frame 1, frame 2 ect

Hope u can help

View Replies !    View Related
Random Number Selection
I need a random value between -200 to 200.
Not sure how to code this. I know how to get a random number between 0 - 200.

random(200);

what about negative numbers too...??

Cheers people.

Regards Bruce

View Replies !    View Related
Random Image Selection
I need my flash movie to randomly cycle through 3+ background images upon refresh. Any suggestions?

Thanks

View Replies !    View Related
Random Movieclip Selection
Hi,

I'm working on a game in which men will be running out of a house (the user will be grabbing the men and dropping them back into the house), but...I suck.

I'd like to have 10 assorted "men" (movie clips), and have flash randomly decide which "man" to play on stage. That would be fairly simply, except that I want many of these guys onstage at any given time (so I can't just have flash randomly choose between keyframes, each of which has 1 different guy onstage). And I've found code for creating random movements of snowflakes and things like that, which I suppose I could use except that I want all these "men" to have the same point of origin onstage and then run (randomly) offstage from there.

Can anyone help me figure this out? I hope this post makes sense.

Thanks, you people rock.

View Replies !    View Related
Random Picture Selection
Hello everyone..

Does anyone know how to do random picture selection on a flash page so that each time it loads it selects one from certain amount on web page?

thanks in advance for your help.

peace

View Replies !    View Related
Random Button Selection
Hi,

I have a movie with 16 buttons.
Each button plays a sound clip in it's "over" state.

I'd like to have a new button that when the user clicks, it will "play" (mouse over??) the 16 buttons in a random order.

Any idea how I can go about this???

Thank you,
paris

View Replies !    View Related
Non-repeating Random Selection
I've been using the below script to select a number at random to play various frames that I've listed in the array. I would like however to set up a non-repeating selection. For example the numbers are selected but none are repeated until the array is exhausted. Then the cycle starts again. Real new to Flash. Thanks!

Wendell




var aLabels = new Array("start", "eyeblink", "start", "timturn", "eyeshift", "start", "eyeblink2");
{
var nRandom = Math.floor(Math.random() * aLabels.length);
gotoAndPlay(aLabels[nRandom]);
};

View Replies !    View Related
Random Track Selection
random track selection
I have an mp3 streming into my site when it loads using the following code on the first frame of the movie

myMusic02 = new Sound();
myMusic02.loadSound("http://www.markwaterfield.com/music/out of osaka.mp3", true);

this works fine but I have been trying to find a way to put a selection of mp3s on line and randomise the code it so it starts with a different one each time and then selects another when the first is is finished.
Can anyone help at all?
Thanks a lot
mark

View Replies !    View Related
Random Image Selection
I was reading through the previous posts and found a way to sort an array of images randomly, but how is it possible to select a random image from an array and return that selection as a string? i think i almost have it, i just dont know what to puf in place of the "sort" comand


Code:
var randomImagArray = ['images/1.png', 'images/2.png','images/3.png','images/4.png','images/5.png','images/6.png','images/7.png','images/8.png',];
randomImageArray.sort(randomSort);
function randomSort() {
return random(1);
}



can someone help me out with this? and if this isnt the best way to do it can you tell me how?

thanks a lot


Chris

View Replies !    View Related
Random Variable Selection
Hi! I'm new in this forum. I have a question. I have a text file named "Facts.txt" and I'm storing my variables in there. Example:
&S1="This is string 1"
&S2="This is string 2"
etc..
I load my variables into my document by writing loadVariablesNum("Facts.txt",0).
That's fine, I have a dynamic textfield with the "fact" variable assigned, I want that when my animation is running, It choose randomly a string and show it into the "fact" textfield.
The number of variables in my text document will change so I can't put a "select" procedure.

Can anyone help me with this please?

Thank you
PS: I'm learning English so I apologize for my horrible grammar

View Replies !    View Related
Random Frame Selection
I have a graphic set to swap single frames. Inside the graphic, I have 10 movie clips each on a different frame. I would like to implement some sort of actionscript that would choose a random frame of the graphic to play during the movie. Can anybody suggest how I might go about doing this? I'm using Flash MX 6

Thanks in advance. If more explanation is needed, please let me know.

View Replies !    View Related
Simple Random Selection
Hi guys,

I have six external flash video files, i need to load one in and have it playback. The selection needs to be random or in order, but never the same file.

The files are located in a folder at the sites route.

Its my first post and I am quite new to Flash, using Flash 8 Professional.

I look forward to hearing from you,

Ray.

View Replies !    View Related
Random Image Selection
Hi

I have an array which contains the names of images(more than 5). I want to choose 5 images at random to display, without repetition. I can get it to choose 5 images but not without repetition. Can someone please help me?

View Replies !    View Related
Random Selection From Three Choices
i need to be able to make a random selection from three choices. Basically i'll have three seperate .swfs (probably named "1.swf, 2.swf, 3.swf") and also three separate mp3 files (probably named same way).

The container .swf will have a function which will probably make a 'random' selection from the three .swfs of which one to load and also make a 'random' selection from one of three mp3 files to load.

no clue how to do this (the random part). can anyone help?

View Replies !    View Related
Random Scene Selection - With A Twist
Hi i am trying to select a random scene (out of 4 scenes)

I have got this to work by when user clicks on a button action sends them to a random frame eg frame 10-13. each frame has a goto and play scene action on it!

This works well, however!

I want it to randomly choose from firstly 4 scenes. then when one is chosen, i want it to choose randomly from the 3 unchosen scenes, and so on untill all 4 scenes have been chosen. Then it must be able to choose from all 4 scenes again.

Please help me !!!!!
I need this for a University assignment! My tutors cant help me!

Thanks

View Replies !    View Related
Multiple Random Node Selection
I am trying to figure out how to populate a load of dyn text fields with data taken from an external XML file. I can bring in the XML and populate etc... but it random thing that's throwing me.

I know a fair bit about XML and flash, but I'm not clever by any means! Does anyone know of any good sites that might help - or indeed does anybody know the answer!

Gryllsie

View Replies !    View Related
Random Selection Of Tell Target Movies
How can I randomly select one of 4 tell target movies?
(Flash MX Actionscript)

View Replies !    View Related
Random Selection Of 4 Tell Target Movies
How do I randomly select 1 of 4 tell target movies?
(Flash MX Actionscript)

View Replies !    View Related
XML MP3 Player Help With Random Selection Corresponding To Buttons
So this is a bit of an unusual problem. I am building an XML based MP3 player. I'm fairly inexperienced with Actionscript, so I copied the code from a friends music player.

The code works great - but the player I am making also has 'highlightable' buttons for each song. It is easy enough to get these buttons to highlight when clicked. However, when first opening the player, it opens a song randomly but obviously the song's button is not highlighted.

Is there a way to have the player highlight the corresponding button when opening?

The cop-out solution would be to just have it open the first song every time. But the random selection could really make returning to the site a new experience.

Here is the code I'm using for the XML player. Does anyone have any suggestions?

playlist = new XML();
playlist.ignoreWhite = true;
playlist.onLoad = function(success) {
if (success) {
_global.songname = [];
_global.songfile = [];
for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
}
}
_root.createEmptyMovieClip("sound_mc", 1);
_root.sound_mc.sound_obj = new Sound();
_global.song_nr = random(songfile.length);
_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
};
MovieClip.prototype.songStarter = function(file, name) {
this.sound_obj.loadSound(file, true);
this.onEnterFrame = function() {
if (this.sound_obj.position>0) {
delete this.onEnterFrame;
this._parent.display_txt.text = name;
} else {
this._parent.display_txt.text = "loading...";
}
};
this.sound_obj.onSoundComplete = function() {
(song_nr == songfiles.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfiles[song_nr], songname[song_nr]);
};



that's it... thank you,

Aaron

View Replies !    View Related
A Selection Of Blocks Random On Stage
maybe someone can help me a little with a function for this:

i have a number of movieclips. let's say 20.
every movieclip contains one black block - and they're all different in size.

i want to put them one by one in random order on the stage until the space on the stage is filled like this:
http://www.kulsdom.com/newstoday/blocks.gif

in other words: when only 4 movieclips fits on the stage it shows 4 movieclips, when 8 movieclips fits... etc etc

and i don't want them to overlap each other...
how could this be done?

View Replies !    View Related
Random Selection Of Tell Target Movies
How can I randomly select one of 4 tell target movies?
(Flash MX Actionscript)

View Replies !    View Related
Random Selection Of 4 Tell Target Movies
How do I randomly select 1 of 4 tell target movies?
(Flash MX Actionscript)

View Replies !    View Related
Random Selection Based On Frequency?
I have an array of 20 strings.
I have to randomly select 1 of them, the problem is that it needs to be based on it's frequency...

Each string has it's own frequency, which is a value out of 10000, that it should appear.
(More than 1 value can have the same frequency, though.)

The lower the frequency, the less likely it is that it will be chosen.
Eg:
some of the values would have a frequency of 1/10000 (so not very likely to be chosen)
some would have a value of 1000/10000 (more likely to be chosen)

So there are only 20 values, I can hardcode the string values and frequency for each one in my app.
I can easily select a random one, but I have no idea how to start with the frequency issue.

The frequencies for each string will all add up to the total frequency amount (10000).

So, I need to select a random string, but the decision has to lean more to a certain values.

View Replies !    View Related
HELP: Random Selection Of Specific Frames To Start MC
Hi,

i posted this about a week ago and am still having trouble. I have 5 MC's on a timeline. I would like the movie to randomly select which frame to start from each time someone visits, but from a selected group of frames.

For ease, lets say I need the MC to start on either frames 5, 10, 15 or 20 at random. Someone posted this script:

// pick a random number and store it in the variable "randomnumber"
randomnumber = random(4);
// Make some if statements

if (randomnumber=1)
gotoandstop(5);
else if (randomnumber=2)
gotoandstop(10);
else if (randomnumber=3)
gotoandstop(15);
else if (randomnumber=4)
gotoandstop(20);

but it seems incomplete and doesn't work... PLEASE HELP!

much obliged...

View Replies !    View Related
Easy Random Frame Selection (no Repeats)
I have searched for the past hour on this topic and still have not gotton the answer I need. I have a movie. It has 18 frames. I would like the user to click on a button and when they do, be taken to a random frame within these 18. When they click again, another random frame will appear. No frame can be repeated, and when all the frames have been used, then I need the user to be sent to the 19th frame. Using what I learned in this forum, I have set up an array in the first frame of the movie:

code: Mytrans = new Array(1,2,3,4,5,6,7,8,9);

The button has the following:

code:
on (release) {
num = Math.floor(Math.random()*Mytrans.length+1);
targframe = Mytrans.splice(num,1);
gotoAndStop(targframe);
}


It sort of works, but still repeats, and obviously does not have the code to jump to the final frame.

Any ideas???

View Replies !    View Related
Pause / Random Element Selection Problem.
Hi. i'm not really very advanced in actionscripting but i tried to do this 3d movement with a short pause each time some image come to front. what it does now is that it's working perfectly just you have to click on some image to get to movement to continue. How do i get the movement to go on without having to click on the image? and it should also keep a short pause each time an element comes to front.

Thanks for the help!

The code that I have is like this.

// create a scene movieclip to contain all 3D elements
// and center it on the screen.
this.createEmptyMovieClip("theScene",1);
theScene.width = 1000;
theScene.height = 800;
theScene._x = 600;
theScene._y = 190;
theScene.depth = 1; // variable to control depth placement

// defines function to set the target of the cameraView
// when you select the star (onPress)

selectStar = function(){
cameraView.target.x = this.x;
cameraView.target.y = this.y;
cameraView.target.z = this.z;
}

// this is the function for displaying the star onscreen

displayStar = function(cameraView, focalLength){
var x = this.x - cameraView.x;
var y = this.y - cameraView.y;
var z = this.z - cameraView.z;
if (z < 0){
this.z += 5000;
this.x = 1500-Math.random()*6000;
this.y = 0;
x = this.x - cameraView.x;
y = this.y - cameraView.y;
z = this.z - cameraView.z;
}
var scaleRatio = focalLength/(focalLength + z);
this._x = x * scaleRatio;
this._y = y * scaleRatio;
this._xscale = this._yscale = 100 * scaleRatio;
this.swapDepths(Math.round(-z));

};

// define array to hold the objects in the scene
objectsInScene = new Array();

// loop through and create 10 stars randomly in the scene
var p = 5;
for (i=1; i<=6; i++){
attachedObj = theScene.attachMovie("star"+p, "star"+String(p)+String(i), theScene.depth + String(p));
attachedObj.x = 350 - Math.random()*1000;
attachedObj.y = 0;
attachedObj.z = i*500;
attachedObj.onPress = selectStar;
attachedObj.display = displayStar;

objectsInScene.push(attachedObj, attachedTextObj);
clearInterval(p);
}

var n = 4;
for (i=1; i<=5; i++){
attachedObj = theScene.attachMovie("star"+n, "star"+String(n)+String(i), theScene.depth + String(n));
attachedObj.x = 550 - Math.random()*500;
attachedObj.y = 0;
attachedObj.z = i*500;
attachedObj.onPress = selectStar;
attachedObj.display = displayStar;

objectsInScene.push(attachedObj, attachedTextObj);
}


var m = 3;
for (i=1; i<=4; i++){
attachedObj = theScene.attachMovie("star"+m, "star"+String(m)+String(i), theScene.depth + String(m));
attachedObj.x = 250 - Math.random()*500;
attachedObj.y = 0;
attachedObj.z = i*500;
attachedObj.onPress = selectStar;
attachedObj.display = displayStar;

objectsInScene.push(attachedObj, attachedTextObj);
}

var j = 2;
for (i=1; i<=3; i++){
attachedObj = theScene.attachMovie("star"+j, "star"+String(j)+String(i), theScene.depth + String(j));
attachedObj.x = 250 - Math.random()*500;
attachedObj.y = 0;
attachedObj.z = i*500;
attachedObj.onPress = selectStar;
attachedObj.display = displayStar;

objectsInScene.push(attachedObj, attachedTextObj);
}

var k = 1;
for (i=1; i<=2; i++){
attachedObj = theScene.attachMovie("star"+k, "star"+String(k)+String(i), theScene.depth + String(k));
attachedObj.x = 450 - Math.random()*500;
attachedObj.y = 0;
attachedObj.z = i*500;
attachedObj.onPress = selectStar;
attachedObj.display = displayStar;

objectsInScene.push(attachedObj, attachedTextObj);
}

for (i=1; i<=1; i++){
attachedObj = theScene.attachMovie("star", "star"+i, theScene.depth++);
attachedObj.x = 250 - Math.random()*500;
attachedObj.y = 0;
attachedObj.z = i*500;
attachedObj.onPress = selectStar;
attachedObj.display = displayStar;

objectsInScene.push(attachedObj, attachedTextObj);

}



cameraView = new Object();
cameraView.x = 0;
cameraView.y = 0;
cameraView.z = 0;
// set a target object in the cameraView to represent the positions
// the camera is easing to in its movement
cameraView.target = new Object();
cameraView.target.x = -20;
cameraView.target.y = 0;
cameraView.target.z = 500;

//if (cameraView.target.z = 500) {
//cameraView.target.z = cameraView.target.z - 500;
//}


// define focal length
focalLength = 400;

// function controlling the camera ease and all displaying
// for objects in the objectsInScene array
easeToTarget = function(){
// ease each camera point to its target point
cameraView.x += (cameraView.target.x - cameraView.x)/5;
cameraView.y += (cameraView.target.y - cameraView.y)/5;
cameraView.z += (cameraView.target.z - cameraView.z)/5;

// run the display function for each object in objectsInScene array
for (var i=0; i<objectsInScene.length; i++){
objectsInScene[i].display(cameraView, focalLength, alphaRatio);
}
};

theScene.onEnterFrame = easeToTarget;

View Replies !    View Related
Random Frame Selection Syntax Error
var frameArray:Array = new Array(23, 1, 34, 18, 27, 31, 42);
function randFrame():Void{
var whereFrame:Number = Math.floor(Math.random()*frameArray.length
)
_root.gotoAndStop(frameArray[whereFrame]);
frameArray.splice(whereFrame, 1);

(There is a syntax error in this script. What is the error?)

View Replies !    View Related
[F8] Problem With Selection.setSelection Function
Hi all,

Please help me in solving my problem in Selection.setSelection:

Problem is that I am working in AS 2 Classes. I am doing simple R&D on Selection Class. I take 2 input text fields one for writing text and second for text which I want to sort out from the previous text field. Below is the code please Help me.


class Search extends MovieClip
{
var Text_txt:TextField;
var find_txt:TextField;
var find_btn:Button;
var findWord:Number;
var textStart:Number;
var textEnd:Number;
public function Search()
{
btnHandler();
}
private function btnHandler()
{
this.find_btn.onRelease = onFind_btn;
}
private function onFind_btn()
{
//trace(this._parent.Text_txt.text.length+" -- "+this._parent.find_txt.text.length);
if (this._parent.Text_txt.text.length>0)
{
if (this._parent.find_txt.text.length>0)
{
Selection.setFocus("this._parent.Text_txt");
findWord = this._parent.find_txt.length;
textStart = this._parent.Text_txt.text.indexOf(this._parent.fi nd_txt.text, 0);
if (findWord>0)
{
textEnd = textStart+findWord;
}
else
{
textEnd = 0;
}
if (textStart>=0)
{
trace(textStart+" -- "+textEnd+" -- ");

Selection.setSelection(textStart, textEnd);// Problem is in this line
}
else
{
Selection.setSelection(0, 0);
}
textEnd = textEnd;
}
}
}

}

View Replies !    View Related
Execute Function When Selection Is Made From Listbox
Hello again, damn it's been a busy day

Is it possible to use some sort of onChange handler with the listbox component.

I did try
code:
myComp.onChanged=function(){

//my code

}

but it not workie



Cheers

Paul

View Replies !    View Related
Has Anyone Tested How Random Is The Math.Random() Function?
Just wondering whether anyone out there has ever run any tests on how random the Math.Random() function is as a random number generator?

I've been asked me to test it to prove that it is random and it seems a pointless waste of time, so I'm hoping to get evidence from elsewhere to convince the powers that be that there's no need to run the tests.

I've googled for it but come up with nothing so I'm hoping there might be someone out there who has already done the research?

View Replies !    View Related
Random Function & Unique Random Numbers
Hello, after some searching i can't seem to find any good explanation to how and why i should use the Math.random() function so maybe i should explain how a function i need should work and someone maybe has some ideas.

I'm making a guessing program where you guess the right answer.

The function i have now randomly selects a number from 0 to 5 and then put's these five numbers into an array, the thing is that i need the numbers to be unique and i have no idea on how to make this.

Another thing i need to do is between these numbers that the random() function gets one is to be removed and instead i put the right answer there so now i also need one of the randomizes numbers to not be the right answer.

Also, how should a Math.random() function call look like so i can edit the range of numbers to randomize from?

View Replies !    View Related
Selection Prototype? - Restrict Selection In A Specific Area Of A Textfield?
Hi,
Does anyone know how to restrict selection in a specific area of a textfield? I am making a shell emulator and I want to keep users from selecting anything except the current line of text.
~Dev

View Replies !    View Related
Selection.setFocus Selection.getFocus Inputting From Mc
i am attaching a number of _mc (my_mc) with a for loop. Inside each my_mc is an input textfield (my_txt)

I want to click on my_mc.my_txt and select the textfield .the following code allow this and i can enter text from the keyboard however I want to add text from a _mc keybooard on screen (here called myBtn_mc).

As soon as I click on myBtn_mc of course I lose focus ... i have tried to use a variable (select) to keep scope&focus ... I keep focus but can not add text via screen _mc

many thanks Neil

View Replies !    View Related
Selection.setSelection || Selection.setFocus Help?
I have text fields I want to run with a tab key in a certian order, and miss one that it seems to go to automatically.
Does anyone know how I can do this with selection.setFocus and Selection.setSelection?
heres the order and what I want it to do,
0 username (if the username has it in there already then go to password instead)
1 password (if the password is there already then go to topic instead)
2 topic (selection.setFocus to topic if the the other two are filled already, then the next selection I want it to go to message after topic)
3 message
If anyone can help me out with this I would appreciate it.
Thanks in advance
Deadsam

View Replies !    View Related
Selection.setFocus(" VariablePath" )...But How To "visit" Random Inputfields ?
Im a teacher and I would like to make a multiplication math game.

The idea (see the attached fla)is that when you push the startbutton the curser starts blinking in a random inputfield and you the have to write the right answer. fx 25. (if its 5*5)
If you write the wrong answer you stay the same place. The wrong answer disappers and the curser still blinks in the same field.
If you write the right answer, the curser jump to another random inputfield and so on. (the right answer stays visible)
When all the multiplication is finish you will get a time, because when you pushed the start button a timer also starts.

Is there anyone who has a tip about how to make that ???

I think I have to give my inputfields a var name and then put the code on the startbutton, but im very new to this and need a start.
I have learned from the board that U can use this code:

Selection.setFocus(" variablePath" )

http://www.macromedia.com/support/fl...ionary643.html

But I want the cursur to jump to random inputfields...

and offcourse the cursur must not "visit" a field twice ????

look at the attach fla file

View Replies !    View Related
How Do U Use Random Function?
i have a password field, which collects passwords from about 20 people. i need to be able to redirect these people to out of falsh movie to a new site depending on their password. for example A goes to site 1, B goes to site 2 and so on.

How is this done??

thanks in advance,
tm

View Replies !    View Related
Random Function
Hi,

I am trying to use the randon function to send the needle of a compass to a random position on a circle, i seem to encounter problems because of the negative numbers that inevitably come up the needle then goes crazy. Could it have something to do with the bounce motion that i have scripted into the needle?

Any ideas, here is the code i have been trying:

on (release) {
var myRandom = Math.floor(Math.random()*360)-1
_root.bounce.hand.rotdest = myRandom;
}

Please help, cheers

Richthemarine

View Replies !    View Related
Random Function - How?
Hello all,
Ive got this function:

theme1(){
xxx......etc
}

Similiarly ive got 7 more theme functions.

When my movie begins I want to randomly activate one of these themes. I tried but no luck.I ve tried something like:
in frame 1:
randomtheme=random(5);
in next frame:
YO="theme" add randomtheme;
"theme" add randomtheme add "()";
YO add "()";

HELP
miiz

View Replies !    View Related
How Can I Use Random Function
hi all i have five movie clips and i want every time i play the flash one of them only is played how

emmmmm i want the code as the follow

4 example my movies are named as follow

1 2 3 4 5

i want a telltarget function to pick one of them and play it i hope im clear

thanks alot

View Replies !    View Related
Random Function
hi

this is probably the easiest question ever posted.
BUT could anyone please explain how to use "random function" in flash scripting? thanks in advance.

View Replies !    View Related
Random Function
was wonder with the random function, when you write it

random (50)

this pulls a number random from 0 to 50.

how ever if i wanted to make something random from 50 to 100 if the only way i can do this is like this

random(50)+50

andy ideas?

View Replies !    View Related
Random Function
Is there any way to get a random function?

I want random video clips (symbols) loading at random/timed intervals.

View Replies !    View Related
Random Function
Hi,

Is it possible to create a random number between two specific numbers?

Rather than just a number between 0 and 1 less than the specified number.

I would particularly like to use this so I can set the alpha of a MC between 50 - 100, and position it in a certain area on the stage.

I am using FlashMX.

Thanks!

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved