Õâ¸ö³ÌÐòÊÇ´Ó2.0 ¸Ä¹ýÀ´µÄ£¬ÊÇÍøÉÏÒ»¸ö³ÌÐò£¬Ö»ÊÇÐÞ¸ÄÁËһЩÄÚÈÝ£¬±ä³ÉÕâÖÖÇé¿ö¡£Õ⼸ÌìûÓÐд³ÌÐò£¬ÓеãÀÁ¶è¡£ÓÚÊǽñÌìÓÖ²¹³äÕâÖÖ²»´íµÄÓ¦Óá£Õâ¸ö³ÌÐò²ÉÓõÄÊÇ»æͼAPI ×î»ù±¾µÄ»æÖÆÏߣ¬µ«ÊǶÔÆä½øÐÐһЩÐ޸ģ¬Ê¹Ëû²úÉúÉÏÃæµÄЧ¹û¡£Æ¯ÁÁ²»£¿ºÇºÇ£¬ÎÒ¶¼¾õ¼¸Æ¯ÁÁ£¬
×÷Ϊ»æͼAPI Ò»¸öÄÚÈݲ¹³ä°É¡£
ºÃ£¬Ïл°²»Ëµ¡£¿´´úÂë
package
{
//»æÖÆÒ»¿ÃÊ÷
import flash.display.Sprite;
import flash.display.Graphics;
import flash.events.*;
public class Main extends Sprite
{
private var shape:Sprite=new Sprite();
public function Main()
{
addChild(shape);
CreatTree(shape.graphics,300, 460, 90, 180,6);
CreatTree(shape.graphics,300, 400, 45, 130,6);
CreatTree(shape.graphics,300, 400, 135, 130,6);
}
//»æͼ¶ÔÏ󣬻ù±¾×ø±êpx,py,½Ç¶È£¬Æ«ÒƳ¤¶È£¬ÊýÁ¿
private function CreatTree(g:Graphics,px:Number,py:Number,angle:Number,len:Number,n:int):void
{
if (n>0)
{
var x1:Number=px+0.1*len*Math.cos(angle*Math.PI/180);
var y1:Number=py-0.1*len*Math.sin(angle*Math.PI/180);
var x2:Number=px+len*Math.cos(angle*Math.PI/180);
var y2:Number=py-len*Math.sin(angle*Math.PI/180);
drawLine(g,n-1,px,py,x2,y2);
var a_l:Number = angle+30;
var a_r:Number = angle-30;
len = len*2/3;
CreatTree(g,x2, y2, angle-Math.random()*10,len, n-1);
CreatTree(g,x1, y1, a_l,len*2/3, n-1);
CreatTree(g,x1, y1, a_r, len*2/3,n-1);
CreatTree(g,x2, y2, a_l,len*2/3, n-1);
CreatTree(g,x2, y2, a_r,len*2/3, n-1);
}
}
//»æÖÆÏß
private function drawLine(g:Graphics,n:int,x1:Number,y1:Number,x2:Number,y2):void
{
g.lineStyle(n,0);
g.moveTo(x1,y1);
g.lineTo(x2,y2);
}
}
}
ÐÞ¸ÄÒ»²¿·ÖÄÚÈÝ£¬ÏÂÃæ»á±ä³ÉÏÂÃæµÄÐÎ×´¡£ÎªÊ²Ã´£¿¿ÉÒÔ³¢ÊÔһϣ¬ÓÉÓÚ³ÌÐòÖ»ÊǶÔas 2.0 ÐÞ¸ÄÀ´µÄ£¬ËùÒÔÕâÖÖ»æÖÆÊ÷µÄÐÎ×´ºÜ²»´í¡£
µ±Ò»ÖÖ֪ʶµãÀ´²¹³äһϡ£Õâ¸ö³ÌÐò²ÉÓõݹéµÄ·½Ê½ÖÆ×÷µÄ¡£ÔĶÁµÄʱºò½ö½ö¿´¿´ÄÚÈݾÍÐС£ÆäËû¾Í²»Óö෽ʽ½øÐС£ºÇºÇ
ºÃ£¬ÔÝʱ¼Ç¼һÏ¡£
Χ½Ë Flash µÄ²»½öÓÐ HTML 5£¬»¹ÓÐ JavaScript£¬ÖøÃûµÄ JavaScript ¿ò¼Ü jQuery ÔÚÔ˶¯ÌØЧ·½ÃæÒѾԽÀ´Ô½Á÷³©£¬ÓÐʱºòÄãÐèÒªµãÒ»ÏÂÓÒ¼üÀ´È·ÈÏËü²»ÊÇ Flash¡£±¾ÎĽéÉÜÁË10¸ö·Ç³£³öÉ«µÄ jQuery Ô˶¯ÌØЧ£¬ÕâЩЧ¹û¿ÉÒÔ¸üÓÐЧµØչʾÄãµÄÄÚÈÝ¡£
1. Á÷¸Ðµ¼º½²Ëµ¥
ÏÂÃæµÄµ¼º½²Ëµ¥£¬µ±Êó±êÔÚÉÏÃæÒƶ¯µÄʱºò£¬»áºÜÁ÷³©µØ´¹ ......
ÔÚwonderfl ÍøÕ¾µ±ÖУ¬ÓкܶഴÒâµÄflash ³ÌÐò£¬³ÊÏÖµÄÊÓ½ÇЧ¹ûÄܹ»¸øÓèºÜ¸ßµÄÆô·¢ÐÔ¡£½ñÌ죬ÓÖÒª¼ÌÐøѧϰflash ¼¼Êõ£¬°ÑÔÚÄÄÀï¿´µ½µÄ¶«Î÷¼Ç¼һÏ£¬ÕâÖÖλͼӦÓÿÉÒԱ仯³öºÜ¶àÉñÆæµÄЧ¹û¡£Ò»¸öÏñËØ¿ÉÒÔµ±×÷Ò»¸ö΢СµÄÁ£×Ó´¦Àí£¬ÎÒÃÇ¿ÉÒÔ²ÉÓÃÉèÖÃÏñËصãλÖõķ½Ê½£¬¶Ô¿Õ°×µÄλͼÊý¾Ý½øÐÐÉèÖõ㣬ÕâЩµã»á·Ö²¼ÔÚλͼ ......
Éú»îµ±ÖкܶàÉÈÐΣ¬ÕâЩÉÈÐοÉÒÔ°ïÖúÎÒÃÇÖÆÔìºÜ¶àÓ¦Óá£Èç֮ǰµ±ÖеÄÌ«¼«µÄ×ö·¨£¬µÚ¶þµÄ·½Ã棬¸öÈË·¢ÏÖÉÈÐοÉÒÔÖÆ×÷һЩ¶¯»¡£ÊµÏÖÒ»¸öÌî³äÑÕÉ«µÄÓ¦Óá£×ö·¨ºÜ¼òµ¥¡£
ÎÒÃÇÏÈ´´½¨Ò»¸öÉÈÐΡ£Ê¹ÓÃAPI»æÖÆÉÈÐΡ£
²éѯ¹ýÏà¹Ø×ÊÁÏ£¬·¢ÏÖÍøÉÏÓм¸Öֵķ½Ê½ ʵÏÖ»æÖÆÉÈÐΣ¬¶øÏÂÃæÕâÖÖÊÇͨ¹ýÃèµãµÄ·½Ê½»æÖÆ¡£¿´¿´ÀïÃæµ ......