Monday, May 2, 2011

Bringing Tweets into Flash using the Twitter API

Hi guys today I come up with another video series in which you will learn how to bring Tweets into Flash using the Twitter API.

Part One

Second Part

Thanks for watching and hope that they will be helpful.

Object in flash that follows mouse

1. Create a simple movie clip with registration point from where you want it to rotate.

2. Select the movie clip and paste the below given script onto that

onClipEvent (enterFrame) {
myRadians = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
 myDegrees = Math.round((myRadians*180/Math.PI));
 _root.yChange = Math.round(_root._ymouse-this._y);
 _root.xChange = Math.round(_root._xmouse-this._x);
 _root.yMove = Math.round(_root.yChange/20);
 _root.xMove = Math.round(_root.xChange/20);
 this._y += _root.yMove;
 this._x += _root.xMove;
 this._rotation = myDegrees+90;
}

That’s it you are done.

Sunday, May 1, 2011

How to draw lines, curves and shapes in Action Scripting 3.0

For drawing a blue line we will write code:

var sp:Sprite = new Sprite();
addChild(sp);
var g:Graphics = sp.graphics;
g.lineStyle(3, 0x1c2fba);
g.moveTo(80, 100);
g.lineTo(420, 100);

For drawing yellow and red lines we will write code:

var sp:Sprite = new Sprite();

addChild(sp);
var g:Graphics = sp.graphics;
g.lineStyle(3, 0xfaf100);
g.moveTo(80, 80);
g.lineTo(420, 150);
g.lineTo(400, 120);
g.lineTo(200, 120);
g.lineStyle(4, 0xFF0000);
g.moveTo(150, 175);
g.lineTo(400, 175);

For drawing curve we will write code;

var sp:Sprite = new Sprite();
addChild(sp);
var g:Graphics = sp.graphics;
g.lineStyle(2, 0x467608);
g.moveTo(150, 100);
g.curveTo(275, 0, 400, 100);
g.moveTo(0, 0);

For drawing a triangle and fill it with color we will write code:

var triangle:Sprite = new Sprite();
with (triangle.graphics) {
lineStyle(0);
beginFill(0x9e0fa3,1);
moveTo(50, 0);
lineTo(120, 120);
lineTo(0, 100);
lineTo(50, 0);
endFill();
}
triangle.x = 50;
triangle.y = 250;
addChild(triangle);

For drawing a Circle and fill it with color we will write code:

var shapes:Sprite = new Sprite();
var gr:Graphics = shapes.graphics;
gr.lineStyle(4, 0x068843, .5);
gr.beginFill(0x330066, .2);
gr.drawCircle(50,50,50);
gr.endFill();
shapes.x = 150;
shapes.y = 250;
addChild(shapes);

For drawing a Circle and fill it with color we will write code:

var shapes:Sprite = new Sprite();
var gr:Graphics = shapes.graphics;
gr.lineStyle(4, 0x330066, .5);
gr.beginFill(0x330066, .2);
gr.drawRect(125,0,100,100);
gr.endFill();
shapes.x = 150;
shapes.y = 250;
addChild(shapes);

Thanks. Looking for feedback.

Creating an application in flash for searchin phonebook

Hi, in this tutorial you will learn how to build a flash application to search the phonebook. Also you will come to know how to handle input field and many more aspect of flash scripting.

1. Create a new file in flash. choose the background color and dimension. for make this application more appropriate choose a telephone image from anywhere you like and import it to flash stage with Ctrl+R.

2. With the help of text tool make an input text area. give it a instance name like "nameField".

3. you can also set a background for that input text by making a solid colored rectangle shape below text field.

4. now create an rectangle below type over it like search. select rectangle and search text and convert it to button. give it an instance name "searchButton".

5. Now below search button make an input text and give it an instance name "resultField" also you can give it a background as you gave to nameField.

6. Now action scripting part:

Make a new layer name it actionscript and on the first frame paste below given script

var directory:Array = [{name:"Sven", phone:"854-664-9652"}, {name:"Michel", phone:"459-6996-4522"}, {name:"Jack", phone:"895-659-4485"}, {name:"Charly", phone:"956-8596-5243"}, {name:"Ana", phone:"127-25485-6695"}];

function getPhoneByName(name:String):String {
for(var i:Number = 0; i < directory.length; i++) {
if(directory[i].name.toLowerCase() == name.toLowerCase()) {
return directory[i].phone;
}
}
return "No Match";
}

searchButton.onRelease = function() {
resultField.text = getPhoneByName(nameField.text);
}

Script explanation:

This script:

var directory:Array = [{name:"Sven", phone:"854-664-9652"}, {name:"Michel", phone:"459-6996-4522"}, {name:"Jack", phone:"895-659-4485"}, {name:"Charly",

phone:"956-8596-5243"}, {name:"Ana", phone:"127-25485-6695"}];

create a directory with five objects, and every object has properties, name and phone.

This script

function getPhoneByName(name:String):String {
for(var i:Number = 0; i < directory.length; i++) {
if(directory[i].name.toLowerCase() == name.toLowerCase()) {
return directory[i].phone;
}
}
return "No Match";
}

defines a function that will be searching directory field to find the concerned phone number. This function like parameter, accept the name and returns result as string.

And this script:

searchButton.onRelease = function() {
resultField.text = getPhoneByName(nameField.text);
}

provides us, that on click on the search button we have a final result.

We're done!

Test your Movie (Ctrl+Enter).


Source: https://sites.google.com/site/pageflipsite/circle/1842621_PhoneBook.fla?attredirects=0&d=1

Saturday, April 30, 2011

Fantastic Bones tutorials of flash cs4/5

Bone tool is a new dimension in flash that can make walk cycle and animation much easier than ever before. so i have searched for some bone and inverse kinematics tutorials for you guys. hope they will be helpful


Adobe Flash CS4 Tutorial- How To Use The Bone Tool



Flash CS4 Bone Tool Tutorial




Bone tool tutorial Flash CS4 Professional (update)




The Bone Tool - Inverse Kinematics in Flash CS4




Flash CS4 Bone Tool Tutorial **REMAKE**




Flash CS4 Bones Tutorial Part 1




Flash CS4 Bones Tutorial Part 2




Flash CS4 Bones Tutorial Part 3




Flash CS4 Bones Tutorial Part 4




Flash CS4 Bones Tutorial Part 5




Flash CS4 Bones Tutorial Part 6

CREATING MOUSE TRAIL WITH ROTATION IN FLASH AS3

this blog is all about use of actionscript 3.0 to make a mouse trail animation with rotation. modification can be done to different aspect of the mouse trail by varying the appropriate numbers.


Process:

1. create a new file with actionscript 3.0.

2. draw a circular shape. select it and convert it to movieclip with name mycircle. keep registration point on centre.

3. you can delete the mycircle movieclip from stage as it is included into library. open library and select mycircle. rightclick on it and goto linkage.

4. on the linkage property window set class as MyCircle. check on "Export for actionscript". press ok. There will be a flash warning window suggesting it can’t find a class named “MyCircle”. No Issue, when we run our movie, Flash will create the "MyCircle" class for us. So go ahead.

5. Make a new layer and name it "actionscript". On the first frame pase the below code.

//Start a timer. Timer calls the timerHandler every 0.2 seconds.
var timer:Timer = new Timer(200, 0);
timer.addEventListener (TimerEvent.TIMER, timerHandler);
timer.start ();
//Get the center coordinates of the stage.
var centerX:Number = stage.stageWidth / 2;
var centerY:Number = stage.stageHeight / 2;
//This function is called by the timer.
function timerHandler (e:Event):void {
//Create a new Circle.
var newCircle:MyCircle = new MyCircle();
//Set the position to same place as where the mouse cursor is.
newCircle.x = mouseX;
newCircle.y = mouseY;
//Calculate x and y distances to the Circle
//from the center of the stage.
var dx:Number = newCircle.x - centerX;
var dy:Number = newCircle.y - centerY;
//Calculate the distance to the Circle from
//the center of the stage (Pythagorean theorem)
newCircle.radius = Math.sqrt(dx*dx + dy*dy);
//Calculate the angle of the Circle from the center
newCircle.myAngle = Math.atan2(dy, dx);
//Set the angle speed (how fast we rotate)
newCircle.speed = 0.06;
//At first,set the Circle to be invisible
newCircle.alpha = 0;
//Assign a random scale to the Circle
newCircle.scaleX = Math.random() + 1.5;
newCircle.scaleY = newCircle.scaleX;
// Get access to the ColorTransform instance associated with the Circle.
var colorInfo:ColorTransform = newCircle.transform.colorTransform;
// Set a random color for the ColorTransform object.
colorInfo.color = 0xffffff * Math.random();
//Apply the random color for the Circle
newCircle.transform.colorTransform = colorInfo;
//Add the Circle to the stage
addChild (newCircle);
//Add ENTER_FRAME to animate the rotation
newCircle.addEventListener (Event.ENTER_FRAME, moveCircle);
}
//This function rotates a Circle
function moveCircle (e:Event):void {
//Get the Circle from the event target
var Circle:MovieClip = e.target as MovieClip;
//Calculate the new x and y positions for the Circle
var newX:Number = centerX + Math.cos(Circle.myAngle) * Circle.radius;
var newY:Number = centerY + Math.sin(Circle.myAngle) * Circle.radius;
//Increase the angle for the next frame
Circle.myAngle += Circle.speed;
//Assign the new position
Circle.x = newX;
Circle.y = newY;
//Decreate the radius to get a "spiral" animation
Circle.radius -= 0.6;
//Reduce the scale
Circle.scaleX -= Circle.radius * 0.0001;
Circle.scaleY -= Circle.radius * 0.0001;
//Increase the alpha if it's not one and radius is larger than 50
if (Circle.alpha < 1 && Circle.radius > 50) {
Circle.alpha += 0.05;
}
//Start decreasing alpha if radius is smaller than 50
if (Circle.radius < 50) {
Circle.alpha -= 0.005;
}
//If radius is smaller than zero, remove the Circle
if (Circle.radius < 0) {
Circle.removeEventListener (Event.ENTER_FRAME, moveCircle);
removeChild (Circle);
}
}

6. Now publish the file. and you will have your circular mouse trail with rotation in action.
Enjoy

Download Source File:
https://sites.google.com/site/pageflipsite/circle/circular.zip?attredirects=0&d=1

50 awsome flash based website you must take a look

1. Saizen Media Studios

saizen-creative-flash-webdesign-inspiration

2.DrawingArt – WebDesign and Development Studio

drawingart-creative-flash-webdesign-inspiration

3. Section Seven

section-seven-creative-flash-webdesign-inspiration

4.Semisture Webdesign

semisture-creative-flash-webdesign-inspiration

semisture-2-creative-flash-webdesign-inspiration

5. Fl-2 Interactive Agency

fl2-creative-flash-webdesign-inspiration

6. Lecaid Design Studio

lecaid-creative-flash-webdesign-inspiration

7. Esj * Com * AU

esj-creative-flash-webdesign-inspiration

8. Recom CGI

recom-creative-flash-webdesign-inspiration

9. Millice – Cyril Louis

millice-creative-flash-webdesign-inspiration

10. HYPR – Interactive and Creative Design Studio

hypr-creative-flash-webdesign-inspiration

11. TwistCube

twist-cube-creative-flash-webdesign-inspiration

12. Go For Change

go-for-change-creative-flash-webdesign-inspiration

13.John Wright Photo

john-right-photo-creative-flash-webdesign-inspiration

14.Timothy Hogan Photography

timothy-hogan-photography-creative-flash-webdesign-inspiration

15.LS5 Design Agency

ls5-creative-flash-webdesign-inspiration

16. SoyTuaire Labuat

soytuare-labuat-creative-flash-webdesign-inspiration

17. Mattthias Dittrich – Interaction Design Portfolio

matthias-dittrich-creative-flash-webdesign-inspiration

18. Museum of Science and Industry

msichicago-preoloader-creative-flash-webdesign-inspiration

msichicago-creative-flash-webdesign-inspiration

19. Parasol Island – Film Animation Interactive

parasol-island-creative-flash-webdesign-inspiration

20.Unouplus

unouplus-creative-flash-webdesign-inspiration

21.MultiAdaptor: Branding & Identify Systems

multiadaptor-creative-flash-webdesign-inspiration

22. Chemical Box

chemical-box-creative-flash-webdesign-inspiration

23.Hello Monday

hello-monday-creative-flash-webdesign-inspiration

24. Blanc Fonce

blanc-fonce-creative-flash-webdesign-inspiration

25. 2Advanced Studios

2advanced-studio-creative-flash-webdesign-inspiration

26.Magnetic North – An Interactive design company

magnetic-north-creative-flash-webdesign-inspiration

magnetic-north-creative-2-flash-webdesign-inspiration

27. In2Media – Digital Agency

in2media-creative-flash-webdesign-inspiration

28. Cartelle – Interactive Studio

cartelle-creative-flash-webdesign-inspiration

29.Progetty Studio

progetty-studio-creative-flash-webdesign-inspiration

30.Narrow Design

narrow-design-creative-flash-webdesign-inspiration

31.Yodabaz – Fresh Webdesign

yodabaz-creative-flash-webdesign-inspiration

32.Aiala Garcia – Art Director and Webdesigner

aiala-garcia-creative-flash-webdesign-inspiration

33.PMA – Projects

miss-architecture-creative-flash-webdesign-inspiration

34. Mcinen

mcinen-creative-flash-webdesign-inspiration

35. Nvidia Speak Visual

nvidia-speak-visual-creative-flash-webdesign-inspiration

36. Okay Dave – Dave Werner Portfolio

dave-werner-creative-flash-webdesign-inspiration

37. Michael Kelley Photography

michael-kelley-town-creative-flash-webdesign-inspiration

38. Maven Interactive

maven-interactive-creative-flash-webdesign-inspiration

39. Unit 9 – The Creative Mind

unit9-creative-mind-flash-webdesign-inspiration

40. CreakTif!

creaktif-creative-flash-webdesign-inspiration

41. Experience 159 – Alfa Romeo

experience-159-creative-flash-webdesign-inspiration

experience-159-alfa-romeo-creative-flash-webdesign-inspiration

42. NikeLab

nikelab-creative-flash-webdesign-inspiration

43. Morris Code

morris-code-creative-flash-webdesign-inspiration

44. CocaCola Zero

cocacola-zero-creative-flash-webdesign-inspiration

45. CocaCola Hapiness Factory

cocacola-hapiness-factory-creative-flash-webdesign-inspiration

46. Living Sasquatch

living-sasquatch-creative-flash-webdesign-inspiration

47. Comcast Town

comcast-town-creative-flash-webdesign-inspiration

48. MadeForEachOther

madeforeachother-creative-flash-webdesign-inspiration

49. Feed Your Ego

feed-your-ego-creative-flash-webdesign-inspiration

50. BePop Jeans

bepop-jeans-creative-flash-webdesign-inspiration