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




How Can I Create Dice In Flash?



I need to create 3D dice in Flash.
I'm not quite sure where to start.

I need the user to click a button and then have the dice roll and land randomly on one side, for example.

Should I use a third party 3D Flash software?
Or can I do it in just Flash?
(I can't think of how I might create true 3D in just Flash.)

Any pointers/suggestions would be really appreciated.

Thanks.


Jam



FlashKit > Flash Help > Flash General Help
Posted on: 06-01-2004, 10:06 PM


View Complete Forum Thread with Replies

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

How Do I Create Roling Dice?
I need to create rolling dice for a project I'm working on.
I need to have 3D animation.
I'm not sure where to start.

Any suggestions?

Any help would be appreciated.

Thanks.


Jam

Making An Interactive Dice In Flash MX 2004
Help!!

I need some urgent help!!

I need to make an interactive dice in Flash & I have Flash MX 2004. If someone could give me a step-by-step gudie for this as I'm a beginner and have no clue!!

Thanks!!

Problem With Flash Board Game "dice" Flash 8
Hello boys and girls

I have a problem. I'm making a board game in flash. Nothing fancy, just a throw the dice and go along the path. My problem is, that in my game I have "dice". Every turn the dice has 6 new different random movie clips to load, which lead to different frames, so I duplicated the "dice" movie clip and gave it names like "dice1", "dice2" and so on. Only because I have no clue how else to do it.

The thing is that after 3 clicks, or throws, the dice should be removed and the game should end. Since the movie clip "dice_n" has only been clicked once no matter what, I have no clue how to make this happen. If I could use the same dice movie clip all over it wouldn't be a problem, but now it is.

Can I, for example, send some info from a button somewhere, and when this somewhere has received the same info 3 times things start happening.

I beleave I do suck in actionscript ;-)

Any help and idears would be greatly appreciated.

Dice
how can you make a dice?

Dice
I was going to post this in math, but i realized its a pretty noob question. This is the random number script, but I am unsure how to make it roll more than one die to display multiple numbers.

on (release) {
display = Math.round (Math.random ()*100);


}

[F8] Dice Help
I am creating a snakes and ladders game, so far I have created the board, and the die. The die is intented to be used so that when it lands on a number the user is moved that many places forward, this is the code I have for the dice so far.

Code:
roll.onPress = function() {
_root.diceNum.text = 1+Math.floor(Math.random()*6);
invisible();
if (_root.diceNum.text == 1) {
_root.dice_1._visible = true;
} else if (_root.diceNum.text == 2) {
_root.dice_2._visible = true;
} else if (_root.diceNum.text == 3) {
_root.dice_3._visible = true;
} else if (_root.diceNum.text == 4) {
_root.dice_4._visible = true;
} else if (_root.diceNum.text == 5) {
_root.dice_5._visible = true;
} else if (_root.diceNum.text == 6) {
_root.dice_6._visible = true;
}
};
function invisible() {
_root.dice_1._visible = false;
_root.dice_2._visible = false;
_root.dice_3._visible = false;
_root.dice_4._visible = false;
_root.dice_5._visible = false;
_root.dice_6._visible = false;
}
The porblem with this code is that I cannot work out what I need to add to it to make my player piece move, I have tried to fix this poblem myself, by making a movie clip with the six die faces, I then created a random variable where it generates a random number between one and six, my code for that looks like this;

Code:
var rndmFace:Number = Math.round(Math.random(5)+1);
_root.die.gotoAndStop(rndmFace);
I then thought could I create a function, that moves the character piece by the random number generated, the only problem is, I am not sure how to go about this, any help would be much appreciated, thank you.

joey.

Dice Score
Hi,
I have these dice that are random:

http://leadminepond.com/tests/diceShake.html

Basically there are 6 movies of dice and 2 of them load randomly at a time.

I would like to have those scores tallied and posted some where on the screen. I would like to be able to display the scores for 6 rolls of the dice. Any ideas

Thanks a bunch you geniuses!!

John GLynn

Roll Them Dice.
I have created a dice rolling page, in which you can pick what dice, and how many times you want it rolled. It uses a Input text box for how many times you want it rolled, and a drop down type of component for the dice it rolls. the instance name for # of dice is "dice", the instance name for the type of dice is "die". What coding would you recomend for me to use for code, so it can display the results in a dynamic text box in the bottom. this format would be best. 5, 4, 3, 2, 4. or similar.

P.S. I plan to use Math.random(_root.die+1) to get the random #'s.

Rolling Dice
Hi, can anyone help me making this dice's movement more fluent? I'd like it to roll in all directions, but just more fluid:

http://www.vetdesigner.it/flash

I'm attaching the FLA. I use AS1. Thanks!

Rolling Dice
hi all
the only flash i know so far it is the one i do with text. but it's a work in process, slowly but surely. what i want to do is i guess animation; a rolling dice that will give an especific number always for instance; six all the time. or any number. can that be done? i'm sure it is possible but for me it 's a nightmare. i know there will be a lot of frames involve. can anyone help me with this task or point to a tutorial, a give me a sample. anything that can get me started and work on it.
i appreciate any feedback, help, cooperation, and your time.
thank you very much in advance

m.e.

Rolling Dice
hello i'm a beginner in actionscript
i'd like to know how i can make a dice roll by draging the mouse from side to side
i'd like it to roll from 3 to 1 AND from 2 to 1
referr to the image here http://azza.alameddine.free.fr/dice.jpg

thank u very much

My Dice Can't Work
even when I put the stop() the frames keep playing. Anyone knows how to help? I've attached my .fla below.

Dice Game
I am... a newbie to actionscript.
I want to make a dice game in flash for a school projet, but after a long search found absolutely nothing.

Would you be able to help?

Basically, I want it so that you guess what number the dice will land on. You type the number into a bo and click a button to roll the dice.
If you get it right a little bo saying ongratulatoins appears or something. I know how to do that last animation bit myself, but not any of the bits about the dice.

So... thats it.

Dice Throwing
Does anyone know how to create a dice throwing application, much like they do on gettheglass.com. You can pick up the dice and throw them and they bounce around the screen. Anyone know where to start making something like that?

Slice And Dice Can't Get It To Work
ok lets say I have a variable
myvar = 24c (by the way I want to allow for more than double digits so this may end up being from 2c to 2345c)

and I want to just read the last letter ie "c"

well I have used the following without much luck

scs = new String(myvar);
scd=scs.substring(-1,0);
trace(scd);

should give me my c shouldn't it?

what am I doing wrong??

Thanx in advance

[MX]movieclip Button = No Dice.
hey there. i have a movieclip button that has what i think to be the correct insides to it, lables and all that. When i went to the main stage i entered the code

this.enter_mc.onRollOver = function() {
enter_mc.gotoAndPlay("_over");
}

this.enter_mc.onRollOut = function() {
enter_mc.gotoAndPlay("_out");
}

this.enter_mc.onRelease = function() {
gotoAndPlay("inside");
}

onto the 1st frame in the actions layer. i have named the movieclip enter_mc, and the syntax reads back as correct. the entire movie is about 56 frames long and has a stop(); at the end of it. the enter button also move with a tween and has a masked image over it.

when i go to view this, either in flash or on a browser the button doesnt even recognize as a button. the gotoandplay("inside") was just put there to see if it would work, and there is a lable "inside" so i dont think that is whats up.
sorry for the stupid question, and thanks for the help. ive done this a million times, i know im just missing one small thing and ive already spent 4 hours looking for it and redoing it.

Risk, Dice Roller
Well, unfortunaly I am new to the action script language, but not programing languages in general. I would love to make a flash application that will roll dice for you in a game of Risk.

My Questions:

1. If I put a function on, lets say the first frame, then call it from the release of a button, will it call it?
2. How do I pull variables in from a text box and display variables in a text box?
3. How exactly do I work with variables. First I must declare them, right? Will "var NumAttackers" work or do I need something more like "var NumAttackers.int". Then while manipulating them I can just say "NumAttackers = 25", or what?

Thankyou in advance for the help!

3d Dice Throw, Physics
Wondering if anyone has been able to make a 3d dice throw that looks believable with a a homebrew 3d physics enginem, wow3d or some other engine

Ive tried wow3d and bolt3d, but i can't seem to make cubes that are rigid.

Anyone got any tips?

Slice And Dice (or Maybe Split) ...
Hello,

Here is my code:

Code:
sectionTitle = topSection.title;
My problem is that sectionTitle = topSection.title which is exactly 1 Intro (thats the numeral '1' followed by 4 spaces, then the text 'Intro'). I just need sectionTitle to be Intro (no numeral and no spaces).

So I think my code needs to be something like

Code:
sectionTitle - topSection.title.splice(?, ?);
or

Code:
sectionTitle - topSection.title.split(?, ?);
or maybe even use lastIndexOf, or substr, or something else ...

HOWEVER, sometimes topSection.title will be 12 Course assessment (which is the numerals '1', '2' then 3 spaces then the text 'Course assessment') - so there is an extra numeral here but one less space before the text starts.

Any help is greatly appreciated.

NOTE: there is always 5 chars (which are either numerals or spaces) before the course title text.


Thanks,
Stephen.

Dice Rolling Problems
I have a dynamic textfield var_name: mcRes and I have a button. On the button I place the following code:


on(press){

dRoller = Math.floor(Math.random() * (7 - 1)) + 1;

_root.mcRes.trace(dRoller);

}

I know that it generates a random number for a D6 , because the output windows says so. However, the result is not being sent to the textfield mcRes.I can't figure out why. Can anyone help me with that one little thing that I'm missing? Thanks.


Dave

AS 2 Dice Rolling Game.
Hey i need to do a dice rolling game, whereby the rolling dice has to be 3D. Any idea on how i can go about doing it? i need to do it using only flash.

Dice Rolling Problems
I have a dynamic textfield var_name: mcRes and I have a button. On the button I place the following code:


on(press){

dRoller = Math.floor(Math.random() * (7 - 1)) + 1;

_root.mcRes.trace(dRoller);

}

I know that it generates a random number for a D6 , because the output windows says so. However, the result is not being sent to the textfield mcRes.I can't figure out why. Can anyone help me with that one little thing that I'm missing? Thanks.


Dave

Making A Dice Move A Counter
Hi,

I'm using Flash 5. I'm making a boardgame where you roll a single die and the random value created moves the counter that number of squares round the board. I've created the board, counter and die movie clip - which now rolls a random number when you hit the "ROLL" button.

I now need to connect the two so the rolled value moves the counter the right number of frames. Here is the actionscript I've assigned to the roll button (the /left value refers to the die):

on (release) {
frame = Number(random(6))+1;
tellTarget ("/left") {
gotoAndStop (/:frame);
}
}

So now I need to add something in somewhere that tells the main movie to jump 1 frame if a one is rolled, or 5 if a five is rolled, etc.

Any ideas?
Once this game is complete I'll post it - it looks great!

Thanks
qwaszx

Random Numbers For Rolling Dice
I'm using flash mx and I've been trying to find a tutorial on how to make up some dice and have them come up with random numbers...such as dice will do...lol..can anyone help me out with a tutorial link or explain how to do it. I'm just getting into the action scripting and haven't gotten very far with it, so be warned. Thanks

Dice And Board Variable Problem
hello

I'm trying to devellop a dice game so I have a roll dice function wich


Code:
var board_place:Number = 0

function roll_dice (board_place){
var dice_number:Number = Math.round(Math.random()*5);
board_place=Number(board_place+dice_number)
}
bt.onRelease=function(){
roll_dice (board_place){
}
but of course everytime I use the rolldice function, the board_place variable is reset to 0.
Can anybody tell me what the structure should be for my board_place variable to store the value created by the function.

thank you

[CS3] Dice Roller With Color Text Results
I am making a dice roller where you can roll multi dice at once...
I want the color of the text to show as certin color based on if the result is a success or not of the variable _root.Got (not the results as a whole). if it gets to the Roll again the roll is green, if it just a Success it blue, if none of them it's red (i know i will need to change it some if i want to putting in color depending on the results of each roll)


here is the code for the dice roller

PHP Code:



while (_root.Temp<_root.TotalRolls) {
    _root.Got = random(9);
    _root.Got = _root.Got+1;
    _root.RollsGot = _root.RollsGot+_root.Got+", ";
    if (_root.Got>=8) {
        if (_root.Got>=_root.RollAgain) {
            _root.Agains++;
            _root.TotalRolls++;
        }
        _root.Success++;
    }
    _root.Temp = _root.Temp+1;
}

Dice Roll Variable To Move Player Peices
I'm a newbie that's working on a board game. I think i may need a great Action Script 2.0 on-line class, but i'm finding there's a lot of free help, tuts, and fla's to help me solve most of my action script so far.

I have two rotating 'Die' in 3-D, which, when the "Roll Dice" button is clicked.... both 'die' stop rotating to show a random dice roll.

What i need to do now is to learn how to Script so the random dice roll ‘Sum’ is a 'variable' that will determine or cue the proper MC to play, indicating automated movement of player pieces (represented by various MCs) preloaded all over the game board.

Any help? Script or FLA maybe? Thanks ahead!

Making A Pawn Move Correctly According To Dice Roll
I'm trying to reach out the solution for the deadlock in my code for days and I'm really becoming, let's say slightly, mad!

I'm trying to create a board game with a dice. I have a pawn which is supposed to move through the fields on the board according to the number on the dice, after it was rolled. The board has rectangle shape.

I've created a function rollDice() which is controlling dice rolling and the movement of the pawn. The dice itself is event handler.
The board itself is within movie clip "map_mc" in which I've created a separated mc, called "node" + the number of the field, for each board field.
So, there are "node0" to "node37" inside "map_mc", as there are 37 fields on the board. The pawn "tiger_mc" is also inside the parent "map_mc".

The problem is next:
I somehow can't achieve that the pawn move from the current field to the next (according to the dice number) step by step. The movement is too quick and the pawn "is cutting" the corner of the board.

Explanation of the code:
The whole code for dice rolling and pawn movement is inside rollDice() function which is called by pressing the dice itself. It tracks both current position of the pawn (var curr_position) and it's next position (var next_position). It also push index of all fields in between into array fields_arr. I've created a counter inside that function which goes through fields_arr elements and changes the pawn's _x and _y accordingly, up to the last field - the new position. But the pawn is moving as directly from the current to the new position (not gradually over the fields in between). So the effect of such movement is that the pawn "is cutting the corner of the board". For instance, if the current position is "node7" (which is on the one side of the rectangle/board) and the next position is "node12" (which is on the next side of the rectangle/board), the pawn is not moving gradually node8-node9-...-node12 but as directly from node7 to node12, not by the corner of the board but cutting that corner!

Snakes And Ladders - Moving A Movie Clip Using Random Value From Dice
Hi there, im fairly new to Flash so this is a basic question...

Ok, i am creating a snakes and ladders game and have so far produced the board, the counter and the dice.

Once the dice is rolled it returns a value called 'rollValue'

The counter is a movie clip with the instance name 'counter' and is set up on the timeline with position 1 on the timeline being the first place on the board, position 2 on the timeline being the second place, 3 on the timeline being 3rd position on board etc etc.

What i need to do is move the counter to the position on the timeline (hence moving it on the board) that is returned by the dice value.

I was thinking something like this:

counter.gotoAndStop(rollValue);

or maybe this on the actual counter which would move it the amount of places determined by rollValue:

on (press) {
gotoAndStop(rollValue);
}

Although im not receiving any errors when testing both of these, the counter isn't moving

Any advice appreciated. Thanks.

- Steve

Create, Delete, Create Event Handlers
Hi,

At the moment I create an onEnterFrame function to ease a movie clip into view. I then delete it. I want to be able to recreate a similar onEnterFrame function later to swoosh the movie clip out of view. At the moment weird things happen when I try and do the second onEnterFrame. Am I doing something illegal here?
I know I could put this all in the original onEnterFrame, but I don't wanna be wasting processor time doing an if statement every frame to work out if it's time to swoosh out the movieclip. Or should I not worry because that's negligible cpu time?

Tom

New To Flash, Create A Flash Form Which Is Emailed Using CGI Script When Submit Button Is Pressed
I'm trying to build a form in flash that is emailed using CGI script. I'm just lost and confused and I just can't seem to figure this out.

This is the CGI coding for HTML and I just need to convert it to use in CS3:
<form action="

Create Java Pop Up From Flash Index Site To Standalone Flash Popup
Want bad help to create a javapop up link from index.htm flash movie with a enter button that leads to the other .swf that is a popup window with another .swf. How do I do that.

One more thing is there a real good downloadable on how to make "news" scrolls in flash the ones I have seen did not please me.

And is there a way to connect that "news" feed scroller to a text dokument for easier updates instead of having to redo the thing in the .fla file

Hope you understand my problems and I would really appreciate all help I can get.

Cheers

Best regards

/s

Looking For FLASH Developer/guru To Create A Flash Intro For A Clan Site.
I am looking for a FLASH developer to create a custom FLASH Intro for my gaming clan forums.

A bit about us:
Clan Name: =bURnT=
Site: http://burnt.swisshut.com
Games Played: Battlefield 2 & Battlefield 2142

What we would like in the Intro:
- That it somehow complements our forums
- Includes the clan name
- Looks professional and loads within reasonable time
- Some sort of music / background soundtrack

We are a small clan and don't have the biggest budget but please consider us and give us a estimate of price if you are able to do this for us.

Regards,
Dieter Balmer (OzButcher)
didaswisshut@iinet.net.au





























Edited: 01/09/2007 at 10:20:52 PM by OzButcher

Flash CS3 With Word 2007 - Unable To Create Flash Object
Hey, I wondered if someone had noticed this problem before. I used a typical install of Flash CS3, as well as Word 07' around the same time ages ago (not really important, but...). Anyhow I was writing up a simple document the other day and needed to throw a flash file into it. When I tried to insert a Flash Object, I got this nifty error:



I'm wondering if anyone might be able to shed some light on this situtation...

If Word is looking for Flash, it's installed to the default Flash CS3 installation folder.

I Wanna Create A Cd With Flash That Open In Every Pc, With Or Without The Flash Playe
I wanna create a cd with flash that open in every pc, with or without the flash player, how can i do that?

Flash 8 Tutorial - How To Create A Flash Contact Form?
Does anyone know how to create a flash contact form in flash 8, using compenents,etc...?

Best regards,

Froez

Flash Script - Create A Transparent Flash Movie
This forum thread discusses the SitePoint article 'Flash Script - Create a Transparent Flash Movie' by SitePoint ScriptMaster.

""

Flash Script - Create A Dynamic Scroller In Flash
This is a dedicated thread for discussing the SitePoint article 'Flash Script - Create a Dynamic Scroller in Flash'

Flash Script - Create A Transparent Flash Movie
This is an article discussion thread for discussing the SitePoint article, "Flash Script - Create a Transparent Flash Movie"

Create Full Screen Flash Website..... New To Flash
Hi

I would like to create a full screen flash website in the browser.

I need the middle part to be fixed width ....ex 950px but the background to repeat as needed depending on the browser size.

Any good tutorials to do this?

Thanks,
Chris

How Can I Get Flash To Create <*br>?
'Ello All...

Erm, having a bit of trouble and wondering if there is an easy answer. I have built an application in flash MX which helps me edit my HTML website. The website runs from a database.

My problem is, when I press enter in a textbox it creates <*p><*/p> tags but I want it to just insert a <*br>.

Any ideas anyone??

Cris.

* just to stop your browser readin' it...

How Do I Create A Pop-up From Flash
Hi guys
I want to create a pop-up from flash to HTML file how do I create that??

Thanks for your help
Sri,

Create A Ftp By Flash
Hello,

I will like put a pdf or .doc file in a internet server...

Can i use a ftp access in a flash movie that it´s in a cd-rom ( the flash movie is off-line... not on line)

thank a lot in advance

mig

I Want To Create A Flash
K, listen, I want to make a flash, yet, I'm not sure if I can do it. Is it free or does it take expensive equipment? I ain't got no money, but I really want to make Mortal Kombat flash videos and join the ranks of the Kombat Pavillion! Someone help me!!! I must know the truth to flash video making!!

How Did They Create This Flash?
Hey everyone

I'd really really appreciate if any one out there could please give me an idea as to how they created this flash slider feature on their website?

I'm sure it's a fairly basic problem, but I can't figure it out for the life of me haha.

here's the link http://www.rbccentre.ca/

Thanks a lot!!!

Can You Create A PDF From Within Flash?
I'm trying to figure out if there is a way to create a PDF doc from within flash.

Here's what I have. I have an xml file that I use to populate content inside my flash movies. I want to be able to put a link/button in my movie that say's create PDF. Then take the xml content and turn it into a PDF and send that to the user in a new window.

Any ideas on how to pull this off or if it is even possible?

Thanks,

Flash Create Xml Without Php
hi guys,

this probably is a stupid question, but can flash generate xml file straight??

i know i can parse the data to php then get php to generate xml file. but what if i want to do it solely with flash? is it possible??

thanks!

How To Create FLASH MAP With XML
Hello,

How to create flash map with source and destination like below website,

URl; http://www.usairways.com/awa/content/routemap.aspx

Help....

mak

How To Create An Add-In For Flash
Hi all,
I would like to create an Add-In tool for Flash IDE. I know there are others add-in all around (i.e. FlashCast), and I want to build mine. But I don't know where to start from: how to interact with Flash? what functions can i use? I think there should be some documentation available... have you any ideas to help me?
Thank you.
bye

marsellus

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