Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > Just for Kicks Challenges

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-06-2007, 09:28 PM   #1
mattkenefick
Chief Breaks-many-phones
 
Join Date: Jun 2007
Location: new york city
Posts: 527
Default lines going in and out of depth

I'm sure you've all seen those flash things where lines and swirling all over the place.. The go at angles, in and out of depths like you're racing along with it.. the curl and what not..


I'm looking to write some code to create lines like that.. Anyone interested in workin on it?

I'll start up with some in a reply to this soon.
mattkenefick is offline   Reply With Quote
Old 07-07-2007, 01:23 AM   #2
mattkenefick
Chief Breaks-many-phones
 
Join Date: Jun 2007
Location: new york city
Posts: 527
Default

Heres a quick rush of an example just to get the right idea in mind:


Just paste and it should do the trick.


Code:
import flash.display.BitmapData
import flash.geom.Rectangle


with(_root){
	lineStyle(1,0xFF0000,50);
	beginFill(0x0,50);
	moveTo(300,200);
	lineTo(320,200);
	lineTo(320,220);
	lineTo(300,220);
	lineTo(300,200);
	endFill();
}


var bmp:BitmapData = new BitmapData(Stage.width, Stage.height, true, 0x000000);

_root.attachBitmap(bmp,1);

_root.vx = 1
_root.vy = 0

onEnterFrame = function(){
	bmp.draw(_root)
	bmp.scroll(_root.vx,_root.vy)
}


var waiter = 0;
var currentTime = 0;

setInterval( 
	function(){   
		waiter++;
					 
		 if(waiter==timesOfChange[currentTime].a){
			_root.vx+= timesOfChange[currentTime].x;
			_root.vy+= timesOfChange[currentTime].y;
			waiter=0
			currentTime++;
		  }
	},100);


var timesOfChange = [ 
	 
	 {a:10,x:1,y:2},
	 {a:5,x:1,y:-1},
	 {a:5,x:0,y:-2},
	 {a:5,x:-1,y:2},
	 {a:1,x:-1,y:2},
	 {a:1,x:-1,y:0},
	 {a:1,x:-1,y:1},
	 {a:1,x:-1,y:0},
	 {a:2,x:0,y:-1},
	 {a:3,x:0,y:-2},
	 {a:3,x:3,y:0},
	 {a:2,x:1,y:2},
	 {a:3,x:1,y:-1},
	 {a:5,x:0,y:-2},
	 {a:5,x:-1,y:0},
	 {a:1,x:-1,y:-1},
	 {a:2,x:-1,y:0},
	 {a:5,x:-1,y:1},
	 {a:2,x:-1,y:0},
	 {a:1,x:0,y:-1},
	 {a:2,x:0,y:-2},
	 {a:1,x:0,y:0}
	 
					 ]
mattkenefick is offline   Reply With Quote
Old 07-07-2007, 07:36 AM   #3
orange gold
got as?
 
Join Date: May 2007
Posts: 507
Default hmm

i think it would be cool if var times of change was equivalent to xmouse and y mouse
orange gold is offline   Reply With Quote
Old 07-07-2007, 02:21 PM   #4
mattkenefick
Chief Breaks-many-phones
 
Join Date: Jun 2007
Location: new york city
Posts: 527
Default

Quote:
Originally Posted by orange gold View Post
i think it would be cool if var times of change was equivalent to xmouse and y mouse
Well the idea isn't to have it follow the mouse. It's to make an animation for an intro, or a rollover or something.

My example was pretty crude, but its just that it can have some 3d feel to it, have the size and alpha of the object change to simulate depth and have it curve etc..

Most of those line animation things you see are videos imported, but I'd like to make a realtime vector animation class that simulates that.
mattkenefick is offline   Reply With Quote
Old 07-07-2007, 05:58 PM   #5
orange gold
got as?
 
Join Date: May 2007
Posts: 507
Default ...

i meant it starts out moving the boxes to the right if your mouse is on the left it will curve around to the left then if you move it up it will curve up and start moving that way and if it gets to your mouse and you dont move the mouse it will curve around and come back to the mouse untill moved
orange gold is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:25 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.