draw a shape in flash tut

This is a discussion on "draw a shape in flash tut" within the Flash & Multimedia Forum section. This forum, and the thread "draw a shape in flash tut are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 5th, 2007, 05:55
New Member
Join Date: Jan 2007
Location: Australia
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
draw a shape in flash tut

In this tut it will (probably) show you how to:
have actionscript randomly place the "point" circles (just so you can tell where your new shape is) but this version it keeps all the old shapes so you keep hitting the button and it just fills the screen up.
also i know nearly everyone that reads these forums can do this but im bored
1. Make a new document, give it a siaxe of 550_x by 400_y, and draw 4 circles whatever shape/size etc. and make them all seperate movieclip symbols (F8).
2. get the properties menu up, for me its on the bottom.
3. Give the first one an instance name of point1
4. give the second one an instance name of point2 and do this for the others
5. make a button, (F8) then button, then bring up the actionscript panel and paste this code (ill try to explain it my best)
Code:


Code: Select all
 
on (press) {
_root.point1._x = random(550); _root.point1._y = random(400); _root.point2._x = random(550); _root.point2._y = random(400); _root.point3._x = random(550); _root.point3._y = random(400); _root.point4._x = random(550); _root.point4._y = random(400); _root.lineStyle(1, 0x000000); _root.moveTo(point1._x, point1._y); _root.lineTo(point2._x, point2._y); _root.moveTo(point2._x, point2._y); _root.lineTo(point3._x, point3._y); _root.moveTo(point3._x, point3._y); _root.lineTo(point4._x, point4._y); _root.moveTo(point4._x, point4._y); _root.lineTo(point1._x, point1._y); }

Code: Select all
on (press) {
pretty simple, it means when this is pressed it does the following
Code: Select all
_root.point1._x=random(550);
this just gives point1 a random _x co-ordinate which is the horizontal line like this ______________
Code: Select all
_root.point1._y=random(400);
does the same as last but gives it a random vertical co-ordinate on the stage
and the rest of them does it for the rest
Code: Select all
_root.lineStyle(1, 0x000000);
we know what lineStyle means yes? (1, is how thick the lines for it are and 0x000000 is its colour which in this case is black
Code: Select all
_root.moveTo(point1._x, point1._y);
is where the line starts and in this case its point 1
Code: Select all
_root.lineTo(point2._x, point2._y);
Ends the line at point 2 and all the rest do the same to make a shape
Code: Select all
}
ends it
6. put this on the frame of it

Code: Select all
stop();

6. if you did what i said you probably got what i got, also hit ctrl+enter to test it and hit the generate button you made to keep making new shapes over the old ones
hope you understood me http://www.mytempdir.com/1149845
when you get it and have it opened in flash just hit ctrl+enter then you can test it

Last edited by Daniel; Jan 8th, 2007 at 10:11. Reason: coding

  #2 (permalink)  
Old Jan 8th, 2007, 10:11
Daniel's Avatar
Elite Veteran
Join Date: Sep 2006
Location: The Kingdom of Rabbits
Age: 21
Posts: 2,051
Blog Entries: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Daniel
Re: draw a shape in flash tut

thanks for that ive edited it to add [code] tags to make it easier to read
Last Blog Entry: Assassin's Creed (Nov 22nd, 2007)
  #3 (permalink)  
Old Jan 10th, 2007, 20:32
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: draw a shape in flash tut

Thank you so much for helping. We will bookmark this great tutorial.

Thread Closed!!
Closed Thread

Tags
generates random shape

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash Designer (Central London, Flash, Flash Games, Flash banners, 22K-28K) CapitalStrategy Job Opportunities 0 Aug 13th, 2007 09:39
Flash Designer (Central London, Flash, Flash Games, Flash banners, 22K-28K) CapitalStrategy Job Opportunities 0 Aug 13th, 2007 09:04
Corel Draw X3 vs. Photoshop CS2/3 Terezita Starting Out 10 Mar 22nd, 2007 08:31
Garbled Shape Tween Text 574839507348250 Flash & Multimedia Forum 0 Feb 10th, 2007 03:11
playing flash within flash with slow internet connection bejamshi Flash & Multimedia Forum 4 Jan 19th, 2007 02:07


All times are GMT. The time now is 19:57.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43