Puzzle Pieces
Hi, I just made a jigsaw puzzle and am trying to get the pieces returned to exactly the same position if they are placed incorrectly. The problem is that they do return but usually go right off the stage so it is impossible to place them on the puzzle again. This is the code I used..
onClipEvent (mouseDown) {
mx = _root._xmouse; my = _root._ymouse;
for (x=0; x<6; x++) { for (y=0; y<4; y++) { piece = _root[x+"-"+y];
if (piece.hitTest(mx, my) and (piece._alpha<100)) {
piece.startDrag();
x = 6; y = 4; break; } } } } onClipEvent (mouseUp) {
stopDrag ();
dx = _root.outline._x-piece._x; dy = _root.outline._y-piece._y; dist = Math.sqrt(dx*dx+dy*dy);
if (dist<10) { piece._x = _root.outline._x; piece._y = _root.outline._y; // set to full color piece._alpha = 100; else (dist>10) piece._x = mx piece._y = my }
}
FlashKit > Flash Help > Flash Newbies
Posted on: 06-04-2002, 08:47 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Puzzle Pieces
hey I'm making a puzzle game and i want the pieces to "lock" in the right place if they're near where it should be. It's a fairly big puzzle but i really need help with the script. right now i have it where they have to be exact and it isn't working out to good due to exact placement. Thanks for your help.
Puzzle Pieces
hey I'm making a puzzle game and i want the pieces to "lock" in the right place if they're near where it should be. It's a fairly big puzzle but i really need help with the script. right now i have it where they have to be exact and it isn't working out to good due to exact placement. Thanks for your help.
Puzzle Pieces
hey I'm making a puzzle game and i want the pieces to "lock" in the right place if they're near where it should be. It's a fairly big puzzle but i really need help with the script. right now i have it where they have to be exact and it isn't working out to good due to exact placement. Thanks for your help.
Puzzle Pieces
hey I'm making a puzzle game and i want the pieces to "lock" in the right place if they're near where it should be. It's a fairly big puzzle but i really need help with the script. right now i have it where they have to be exact and it isn't working out to good due to exact placement. Thanks for your help.
Puzzle Pieces
hey I'm making a puzzle game and i want the pieces to "lock" in the right place if they're near where it should be. It's a fairly big puzzle but i really need help with the script. right now i have it where they have to be exact and it isn't working out to good due to exact placement. Thanks for your help.
the .fla is located here...
http://www.geocities.com/allisan16/Puzzle.fla
Two Pieces Of A Puzzle.
Hi All,
Another silly question by a newbie.
Imagine having two piece of a puzzle. They are two movieclips.
I near them so that they fit well, my problem is that one of this piece hide part of the second because movieclip are rectangular.
Is a a transparency problem or whatever?
How can avoid this?
Thanks a lot.
Two Pieces Of A Puzzle.
Hi All,
Another silly question by a newbie.
Imagine having two piece of a puzzle. They are two movieclips.
I near them so that they fit well, my problem is that one of this piece hide part of the second because movieclip are rectangular.
Is a a transparency problem or whatever?
How can avoid this?
Thanks a lot.
Scrambling Puzzle Pieces
Hi,
im really new to actionscript (2 days) and ive made a puzzle in which i want have the user able to press a button and scramble all the puzzle pieces.
Each piece is its own movie clip (with a button inside it) and each movie clip is named as follows: piece1, piece 2, piece 3 etc.
On the Scramble button i was thinking that i could put:
on (release){
_root.piece1._x = Math.floor(Math.random()*100);
_root.piece1._y=Math.floor(Math.random()*100)+40;
_root.piece2._x = Math.floor(Math.random()*100);
_root.piece2._y=Math.floor(Math.random()*100)+40;
(etc.)
}
but of course this doesnt work. Im having problems knowing where to go from here.
Any suggestions would be greatly appreciated
How To Make The Pieces In The Puzzle Tutorial?
hi all,
Most of you must know the puzzle tutorial in the folder:
../FlashMX/Tutorials/ActionScript/Finished
The question I want to ask is: Is there any way (as fast as possible) to redraw the pieces every time I have a new picture to make the game? I've tried with photoshop 7, especially with the "Custom Shape Tool" but it didn't help me much.
Better than that,is there any way to automatically generate the pieces whenever the user want to change photos (what I meant is to customize the game with the picture, the number of rows, the number of columns,etc...)?
Thanks for answering
Puzzle With Pieces Appearing At Random, Non-repeating
I'm trying to create a puzzle wherein the pieces pop up randomly (and non repeating) one at a time, the player drags them to the correct position, a new piece pops up, you drag it to it's position etc until complete. That doesn't sound so hard to me, but I've been trying to do it for 3 weeks and have some pretty shabby script to show for my efforts...I'm way more of a designer than a programmer
Here's a link to an swf which shows exactly the functionality I'm looking for:
http://www.juliendesign.com/geography/canada.htm
Can anyone help?
Thanks,
Denny
How To Know That All The Pieces Are Done?
How I would know that whether user clicked all the pieces or not? And if all the pieces are done the movie should go to next frame.
Any help will be greatly appriciated.
Time In Pieces
Hello,
I want to create a screensaver that indicates the time, but not with text but with graphics. For that I've already created a movie that checks which number a certain variable is, and then through linkage it changes the instance to another... .
Now my question is: How can I put the time in my variables?
I work with 6 variables: 2 for the hours, 2 for the minutes and 2 for the seconds. Everything is put on the first frame and I use flash MX.
A second question: I will be exporting this movie as a projector from out of Shockwave studio 8.5. Will it be able to be seen on every computer, because the linkage script is strictly MX... ?
greetings, Robin
Any better solutions are also welcome.
Losing Pieces Of .fla
hello,
ive been working with someone else on a flash project and whenever i take my fla file, which includes a video, and put it onto a shared drive or burn it for this other person to take and update it is missing layers and the video. it just seems real messed up.
has this happened to anyone else?
this actually happened with someone else at another location too.
could it be my computer or install?
Loading Pieces?
I feel so stupid asking this question since it seems like the answer should be obvious or easily found somewhere but, here I am asking anyway.
I'm in the process of redoing a portfolio site in flash and I don't want it to get too big, at least the initial download.
So my question is this: How do you load a part of a movie? I've seen it done in tons of places, so I'm sure it's pretty common practice now.
It would work like this: Load initial movie, then when you click on a part of the nav it would load that section or, if individual flash projects it would load that project, with a loading bar or whatever letting the user know how long it would take.
Please help - sorry for such a stupid question
Crystal
Help On Counting Pieces...
Hi! Lets say we have 3 pieces of pizza (movie clips: 1pizza, 2pizza, 3pizza)and we want to share them to 3 children (movie clips: 1child, 2child, 3child).
When i drag & drop the pieces on the children, i want somewhere on the children's body to show how many pieces each of them ate.
Thanx a lot, your help here is very precious
Mouse Causes Pieces To Come Together
i have about 10 floating pieces (movie clips). How do i use actionscript to get them so that when you rollover a certain area, all these pieces come together in a fixed position to make a full piece?
[F8] Loading In Pieces
I know how to make a preloader but the game i'm working on is way too huge and i need to load it in parts,like every frame needs to be loaded seperately.
Jigsaw Pieces
Hi
I have been asked to create a load of jigsaw pices that need to be animated just simple teweens etc.
How would I go about drawing the pieces in flash, does anyone have any examples or templates, or how I would draw it in flash?
Help!!
Thanks
Mc To Big, How Can I Load It In Pieces?
I am creating a map. I've written an action script with a classic preloader, Scaling (for zoom in and out). However the only way for me to have a decent mc is by making it of poor quality. How can i make one of better quality?
Preloading In Bits & Pieces....
Hi, all - I have a Flash file I'm making for work, and it's getting kind of large for users that may have a dial-up. I have a pre-loader on the beginning of the movie (one I got from a tutorial on Programming By Art), but I was wondering if there was a way to maybe preload like 200k or something, and then as the movie was going have the rest being loaded in the background?....
If this is confusing, I basically just wanna have the user interacting with the beginning of the presentation I've made, while at the same time the middle and end is loading - so that they don't have to sit through like the movie's entire 2MB or whatever before beginning....
Even dividing the presentation into like segments where they preload one part, then interact with it, then preload another part, then intereact with THAT, would be okay I guess....
My file is 550kb now, so I can't attach it as an example, but you can view it so far online at:
http://anixter.iperformonline.com/co...er/process.swf
That might make it clearer what I'm getting at - thanks!!!....
Preloading In Bits & Pieces....
As a disclaimer, I had posted this in the "newbies" forum a few days ago, and have not gotten an answer - I know I'm not supposed to post the same thing in multiple forums, but my original post is a few pages down in "Newbies", and I don't forsee anyone there helping me. Plus, it's probably an actionscripting thing anyways, and I'm REALLY in need of an answer!!!....
Hi, all - I have a Flash file I'm making for work, and it's getting kind of large for users that may have a dial-up connection. I have a pre-loader on the beginning of the movie (one I got from a tutorial on Programming By Art), but I was wondering if there was a way to maybe preload like 200k or something, and then as the movie was going, have the rest being loaded in the background?....
If this is confusing, I basically just wanna have the user interacting with the beginning of the presentation I've made, while at the same time the middle and end is loading - so that they don't have to sit through like the movie's entire 2MB or whatever before beginning....
Even dividing the presentation into like segments where they preload one part, then interact with it, then preload another part, then intereact with THAT, would be okay I guess....
My file is 7000kb now, so I can't attach it as an example, but you can view it so far online at:
http://anixter.iperformonline.com/co...er/process.swf
That might make it clearer what I'm getting at - thanks!!!....
Splitting One Variable Into Pieces
Is there a method to split one variable into different variables?
Ex: I have a text input field with variable "text" when I type for example "this ;should ;be ;split" I want the 4 words to be assigned to variables 1, 2, 3 and 4...
so that the ; is the point where it splits, can be any carracter, best would be the space.
It realy needs to come from ONE variable since this SWF will be controlled by an external app that can only take one variable...
Thanks a lot
Drop Shadow And Other Pieces Of Joy
I'm working on a menu and have encountered a couple of font realted issues. The first is to do with blurry text. I'm using a nice pixel font from miniml that I've used before. All the words are displyed on level plains (75.0 rather than 75.3 for example) and yet some a crystal clear while others remain blurry.
The other issue is to do with drop shadows. I want to know how to create consistant drop shadows for all the text. I tried simply copying each set of words re-colroing them black and then overlaying them but there's no way to keep them all consistantly overlayed to the same degree. I also don't want to break the words apart as I may need to update them regularly.
Any suggestions most welcome!
Chop Up Hex 0xFFFFFF Into Three Pieces
Hello,
I can't seem to get this to work.
I have a hex colorcode that I need to chop up into three parts.
It's for a colormixer app.
So I need to convert this :
0xFFFFFF
into this :
FF FF FF
Thanks for any help!!
regards
Lars J.
Taking Pieces From A Variable?
If I have a variable like:
ocean = "2 fish 5 seals"
can i use AC to separate the ocean variable and get other variables from that string?, eg:
animal1 = fish
animal1number = 2
animal2 = seal
animal2number = 5
Jigsaw Scramble Of Pieces
I'm making a jigsaw puzzle and the pieces get mixed up at first, and therefore have new initial x,y coordinates.
How could I randomly mix the pieces on the board, and then capture the x,y coordinate of that random position to plug in to my code below?
Below is the code in the drag n drop function that either snaps the piece to the correct position or snaps the piece back to its original position (if it's not placed in the correct drop target):
Code:
{
if (this._droptarget == "/something") {
this._x = _root.something._x;
this._y = _root.something._y;
}
else{
this._x = 440;
this._y = 320;
}
}
The x=440 and y=320 would be randomly generated in the beginning and then plugged into this statement.
1. How do I randomly mix the objects on stage up?
2. How do I capture their randomly generated x,y coordinates and place it into the code above?
Thanks.
How To Recombine Pieces Of Image
Hello there...
I have problem in recombine image that have been sliced into pieces. It is a very big size of image, therefore i want to display it part by part. Please help me on it.
Regards,
Jacklynn
Advice For Portfolio Pieces
Hi, I'm always adding items to my portfolio website. I have a couple websites with Flash and some print material. But I really want to focus on transitioning over to being only an Interactive Flash Designer. I have a design background and am really only interested in animation for the web, front-end design as opposed to back-end scripting. Not interested in application development at all, pretty much a visual person only. But I do only use actionscript with my animations when working in Flash, most of the time. So I'm looking for feedback as to what would be some examples I could work on and show in my site that would represent an Interactive Flash Designer? So when I'm looking for work I can show that I am that person the company wants to hire. These are my ideas that would all be in flash, please give me some advice for anything else:
- A Flash video piece with some animated typography
- An art gallery website
- A photographer website
- A couple animated banners (I hate banners but that's why I'm asking for advice)
What else besides websites?
How Do I Make Flash Pieces Be Alone
I need to make my MP3 player from my other topic by its self, so when I export it, it doesn't have all the white space around it. How do I do this?
Edited: 12/13/2006 at 08:56:19 PM by Phat_Tony_13_2006_16
How To Rotate Jigsaw Pieces
Hi all,
I'm having a problem with rotating individual jigsaw pieces. When I click on a piece (movie clip) and try to rotate it using the space bar another piece rotates instead. Here is the script that I'm using:
on(press){
startDrag(this);
this.swapDepths(100);
}
on (keyPress "<Space>"){
this._rotation +=90
}
on (release){
stopDrag();
if
(this._droptarget=="/target1")
{
setProperty(this,_x,322.9);
setProperty(this,_y,89.7);
}else{
setProperty(this,_x,141.2);
setProperty(this,_y,91.3);
}
}
It seems that I need to specify the instance name of each piece in the respective scripts. The instance name of the 'jigsaw piece' above is 'piece 1'. Could someone please help in correcting this script.
Thanks
Repeating Bits And Pieces
Hi there
with this flash movie i got, theres 2 parts, an intro part, which needs to stay on screen, but doesn't do anything else after it enters. (2 layers)
the 2nd part, is a repeat. (has 8 layers).
whats the best way to go about this? i'm guessing actionscript is the way.
i only know the stop command, but that didn't work when i had all layers in once scene, it just stopped the movie. (surprise surprise).
thanks
How To Rotate Jigsaw Pieces
Hi all,
I'm having a problem with rotating individual jigsaw pieces. When I click on a piece (movie clip) and try to rotate it using the space bar another piece rotates instead. Here is the script that I'm using:
on(press){
startDrag(this);
this.swapDepths(100);
}
on (keyPress "<Space>"){
this._rotation +=90
}
on (release){
stopDrag();
if
(this._droptarget=="/target1")
{
setProperty(this,_x,322.9);
setProperty(this,_y,89.7);
}else{
setProperty(this,_x,141.2);
setProperty(this,_y,91.3);
}
}
It seems that I need to specify the instance name of each piece in the respective scripts. The instance name of the 'jigsaw piece' above is 'piece 1'. Could someone please help in correcting this script.
Thanks
Small Flash Pieces
Hello,
I am building a site with small flash pieces, like a flash navigation bar or a flash photo.
The flash photo, for example, is smaller in kb size than the same photo saved as a jpg.
Regarding download, will the flash photo download faster, or will it not download faster because simply because it is flashed?
Please let me know...thanks for all help.
New To Flash, Need A Few Pieces Of Advice
i was wondering a few things
-how do u animate...i know u use frames but i cant figure out how
-are there any other tools? i cant get very good design with the tools provided.
and does anyone know of a good basic tutorial of animation?
thanks
-Elliotz
My Portfolio Pieces Presented In .swf
Hi Ultrashock, i'm planning on presenting my folio pieces using the .swf format. There will be roughly 6 different files containing either video or several still images that i would like to present as a slideshow.
The problem i'm having is i know what i want but i'm not sure how to get there.
I want each .swf to preload with a percentage bar, once sufficiently loaded a cool transition takes place then you are presented with the video or slideshow.
I want the user to be able to watch the media with some control, i.e the slideshow flicks through every 5 seconds automatically and you also have little left & right buttons. The video likewise should have basic controls
The video's are quite large, approx 5-10minutes each.
I can't image that this is out of the reach of Flash's abilities although i'm at a loss on how to go about this.
I hope to finish this part by the end of the weekend so any help would be much appreciated.
Alistair
Jigsaw Scramble Of Pieces
I'm making a jigsaw puzzle and the pieces get mixed up at first, and therefore have new initial x,y coordinates.
How could I randomly mix the pieces on the board, and then capture the x,y coordinate of that random position to plug in to my code below?
Below is the code in the drag n drop function that either snaps the piece to the correct position or snaps the piece back to its original position (if it's not placed in the correct drop target):
Code:
{
if (this._droptarget == "/something") {
this._x = _root.something._x;
this._y = _root.something._y;
}
else{
this._x = 440;
this._y = 320;
}
}
The x=440 and y=320 would be randomly generated in the beginning and then plugged into this statement.
1. How do I randomly mix the objects on stage up?
2. How do I capture their randomly generated x,y coordinates and place it into the code above?
Thanks.
Load Xml Pieces In There Place
Hi ALL!
Im trying to figure out how to get my xml in its locations as maped in the jpg below. Ive read alot about xml and actionscripting but Im just not positive how to get it in its locations.
Do I load it in a text field apon its instance name? I need some help.
Im a graphic artist and code isnt my specialty. Any help would be really apreciated. Even willing to trade mediums.
Thanks
Need Map Pieces Receive Color Info From .txt
I want the .swf pieces that load in to make up my map each to get their own color that I will assign in a text file. I need to know how it should look in flash, and how the text file should look. Any help would be much appreciated.
Sliding Pieces Picture Game
I am trying to create a sliding pieces picture game - you the kind ypu had when you were young with one piece missing so you can move the other pieces around
Does anyone have an action script code for this?
Thanks
MARK
Makeing All The Pieces Fit, Making 1 Long 1
Dear; Helper People
I'm super close to finishing, but Its not loading all that nice. Some dont load and its slow.
What I had done was make 6 different sections, meaning.
I made one part of the movie, saved it. Then opened a new file and made the other part of the movie.
I tried to link them togeather using 'loadmovie' but its not really working. Some frams load, and if they do its like 5mins later.
How can I make it into a nice long con't movie, with out waiting for super lots of loading?
-Thanks
How To Increase Speed Of Drag Pieces?
Hi there,
I created one puzzel. You can see the game at:
http://www.geocities.com/sherly_isaac/puzzelflash.swf
It is very slow in moving(dragging) the pieces. How can I improve the speed of this game? Any suggestions will be appreciated.
Sherly
Who Can Help Me Mixing These Two Pieces Of Code In Flash5?
Hi all,
I want to blend two scripts into one:
A preloader script + a script where the MC is being faded to 0% alpha.
I want to combine them so that when the percentage reaches <99%, the preloader MC (preloader) is being faded to alpha 0%.
code:
onClipEvent (enterFrame) {
if (this._alpha>=1) {
this._alpha = this._alpha -= 10;
}
}
but because of the IF statement of the alpha fade script, I can't really implement it correctly in the if (percent>99) { action. I want it where I now have the _visible property.
And if it would be possible, I would like the '_root.content.gotoAndPlay(3);' line to wait untill _root.coverover.preloader.alpha = 0; (so that would be another IF statement)...
So how to I mix all this into one working actionscript???? Hope someone can help me
code:
onClipEvent (enterFrame) {
loading = _root.content.getBytesLoaded();
total = _root.content.getBytesTotal();
percent -= (percent-((loading/total)*100))*.25;
per = int(percent);
percentage = per+"%";
loadBar._width = per;
if (percent>99) {
_root.coverover.preloader._visible = 0;
_root.content.gotoAndPlay(3);
}
}
Drag And Drop Jigsaw Pieces
Hi
I would like to create a movie were the user drags jigsaw pieces to fit them together. My question is:
Is it best to try an image editor to chop up an image into jigsaw shapes or does Flash have this facility.
thanks
David
Removing Pieces Of A Movie Clip
i want to be able to remove just a small piece of a movie clip, say a circle, by shooting at it, like in this game: http://www.newgrounds.com/portal/view/397568
i cant figure out the shooting, and i know how to remove a whole movie clip
but i was wondering if anyone knew how to just take a piece out
Is There A Way To Access Commonly Used Pieces Of Code?
Like, I use
onClipEvent(load){this._alpha = 0;}
A lot.
And I always find myself writing it out...and it's a pain in the ass. I wish there was a way you could save commonly used snippets of code and just easily access them whenever.
Is there a way?
Thanks.
A Class To Make A Window Out Of Pieces
i'm working on a class that creates a window using nine seperate mcs (see diagram below) to create the corners and the sides. Positioning the corners is relatively easy. The part that is a little harder is working out how to tile the side pieces. Any ideas?
|