2012-08-22 50 views
0

我已經使用as3 tweener創建了以下動畫。AS3吐溫翻轉會影響舞臺上的其他元素

http://circletest.richardbarberwebdevelopment.co.uk/

當你翻轉圓的節圓動畫和字幕顯示。當您展開時,它會回到它的初始狀態。

它一切正常,但隨後出於某種原因,隨機當你翻轉一個部分文本爲完全不同的部分出現!

我不知道它是怎麼發生的,我不能「讓」它發生,所以我不知道爲什麼會發生。我所能做的就是不斷地將鼠標移動到各部分上,直到發生故障。

任何人都可以幫忙嗎?

這是我的代碼示例,對不起有點長!

import flash.filters.*; 

import caurina.transitions.*; 

import caurina.transitions.properties.FilterShortcuts; 

FilterShortcuts.init(); 

// Label 1 
Tweener.addTween(Object(this).main_lab_01.txt_fr_top, {x:50, y:40, width:114.35, height:18, time:0, alpha:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_01.txt_fr_bot, {x:0, y:69, width:116, height:23, time:0, alpha:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_01.label_01, {x:2, y:14, time:0, alpha:0, transition:"easeOutBounce"}); 
// label 2 
Tweener.addTween(Object(this).main_lab_02.txt_fr_top, {x:50, y:40, width:114.35, height:18, time:0, alpha:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_02.txt_fr_bot, {x:0, y:69, width:116, height:23, time:0, alpha:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_02.label_02, {x:2, y:14, time:0, alpha:0, transition:"easeOutBounce"}); 
// label 3 
Tweener.addTween(Object(this).main_lab_03.txt_fr_top, {x:50, y:40, width:114.35, height:18, time:0, alpha:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_03.txt_fr_bot, {x:0, y:69, width:116, height:23, time:0, alpha:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_03.label_03, {x:2, y:14, time:0, alpha:0, transition:"easeOutBounce"}); 

//GROUP 1 (INITIAL STATE) 

Tweener.addTween(Object(this).icon_group_02.block2, {x:257.7, y:116, width:72.15, height:59.4, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.block1, {x:310, y:141.35, width:63.05, height:49.7, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bush1, {x:194.95, y:96, width:68.95, height:22.45, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree1, {x:226.30, y:88.5, width:48.8, height:80.85, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree2, {x:223.85, y:80.05, width:17.8, height:33.15, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.chapel, {x:160.95, y:79.15, width:46.85, height:79.15, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bush2, {x:113.35, y:89.8, width:49.35, height:25.2, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree3, {x:133.25, y:77.5, width:17.85, height:33.25, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree4, {x:124.45, y:83.1, width:13.6, height:25.3, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.cloud2, {x:125.65, y:19.25, width:25.5, height:17, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.cloud1, {x:86.25, y:43.75, width:41.2, height:26.35, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.block3, {x:70.25, y:97.80, width:55.65, height:50.5, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bush3, {x:28.35, y:137.2, width:68.35, height:48.95, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bubble1, {x:20.2, y:102.85, width:40.90, height:32.5, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bubble2, {x:0, y:105.85, width:35.25, height:40.25, time:0, rotation:0, delay:0, transition:"easeOutBounce"}); 

//group 2 initial state 

Tweener.addTween(Object(this).icon_group_04.tree2, {x:79.9, y:81.4, width:90.35, height:71.95, time:0, rotation:-18.75, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.sun, {x:127.4, y:2.4, width:38.75, height:41.9, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.cloud1, {x:125.55, y:12.7, width:20.7, height:34.95, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.tree5, {x:91.1, y:10.6, width:31.65, height:19.15, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.tree1, {x:90.8, y:16.85, width:46.25, height:27.85, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.bush1, {x:52.85, y:72.35, width:43.45, height:66.1, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.bench1, {x:62.9, y:106.95, width:33.9, height:37.9, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.bench2, {x:45.1, y:137.6, width:22.1, height:22.1, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.bush2, {x:0, y:153.7, width:46.75, height:42.8, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.tree4, {x:24.95, y:170.2, width:54.15, height:55.8, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_04.tree3, {x:18.65, y:182, width:20.9, height:23.95, time:0, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).wifi, {x:674, y:443, width:52, height:51.15, time:0, rotation:0, transition:"easeOutBounce"}); 

// Group 3 initial State 

Tweener.addTween(Object(this).icon_group_03.runner, {x:29.45, y:29.95, width:27.85, height:24.35, time:0, rotation:0}); 
Tweener.addTween(Object(this).icon_group_03.golf, {x:20.70, y:33.9, width:60.6, height:63.15, time:0, rotation:-3.1}); 
Tweener.addTween(Object(this).icon_group_03.bike, {x:50.8, y:96, width:42.2, height:44.75, time:0, rotation:0, delay:0}); 
Tweener.addTween(Object(this).icon_group_03.shower, {x:60.1, y:63.8, width:80.45, height:68.25, time:0, rotation:-6.8}); 
Tweener.addTween(Object(this).cloud_bg_3, {x:748, y:192, width:179, height:203.1, time:0, alpha:0}); 

Tweener.addTween(Object(this).cloud_bg_4, {x:530.1, y:725.8, width:261.8, height:196.95, rotation:-170.7, time:0, alpha:0}); 



// animate group 1 function 
Object(this).segments.segment1.addEventListener(MouseEvent.ROLL_OVER, doThis1, false, 0, true); 
Object(this).segments.segment1.addEventListener(MouseEvent.ROLL_OUT, doThat1, false, 0, true); 
// animate group 2 function 
Object(this).segments.segment2.addEventListener(MouseEvent.ROLL_OVER, doThis2, false, 0, true); 
Object(this).segments.segment2.addEventListener(MouseEvent.ROLL_OUT, doThat2, false, 0, true); 
// animate group 3 function 
Object(this).segments.segment3.addEventListener(MouseEvent.ROLL_OVER, doThis3, false, 0, true); 
Object(this).segments.segment3.addEventListener(MouseEvent.ROLL_OUT, doThat3, false, 0, true); 


function doThis1(event:MouseEvent):void{ 
// group 1 
Tweener.addTween(Object(this).icon_group_01.tree1, {x:61, width:40, height:44.2, rotation:-20, time:1, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tree2, {y:-34, width:54, height:60.15, rotation:10, time:1.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.bush, {x:83.9, y:29.4, width:60, height:82.95, time:1.75, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.rainbow, {x:38, y:-8, width:60.5, height:92.55, rotation:-14, time:1.75, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tower1, {x:48, y:-8, width:40, height:30.2, rotation:10, time:1, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tower2, {x:43, y:4, width:66, height:40.3, rotation:0, time:1, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tower3, {x:34.7, y:25, width:100, height:53.2, rotation:2, time:1, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tower4, {x:21, y:75.15, width:44.05, height:28.4, rotation:-13, time:1, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.gmex, {x:50.4, y:82.2, width:53, height:98.75, rotation:0, time:1.5, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.beetham, {x:21.2, y:53.25, width:127, height:63.05, rotation:-9, time:1.5, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_01.txt_fr_top, {x:50, y:0, width:114.35, height:18, time:1, delay:0.25, alpha: 1, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_01.txt_fr_bot, {x:0, y:109, width:116, height:23, time:1, alpha:1, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(this.main_lab_01.label_01, {x:2, y:14, time:1, delay:1, alpha:1, transition:"easeOutCubic"}); 
Tweener.addTween(Object(this).cloud_bg_2, {x:108, y:373, width:265, height:312.65, time:1, delay:0.5, alpha:1, transition:"easeOutBounce"}); 
} 

function doThat1(event:MouseEvent):void{ 
//group 1 
Tweener.addTween(Object(this).icon_group_01.tree1, {width:19.7, height:21.8, rotation:0, time:1, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tree2, {width:27.75, height:30.95, rotation:0, time:1.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.bush, {x:70, y:3, width:32, height:44.25, time:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.rainbow, {x:38, y:-8, width:32, height:66.25, time:1.25, rotation:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tower1, {x:48, y:-8, width:24.6, height:18.6, rotation:0, time:1, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tower2, {x:42.8, y:-0.2, width:39.95, height:24.4, rotation:0, time:1, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tower3, {x:34.7, y:19.75, width:64, height:34.05, rotation:0, time:0.75, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.tower4, {x:19.4, y:75.15, width:23.95, height:11.55, rotation:0, time:1, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.gmex, {x:43.1, y:64.05, width:39.35, height:73.35, rotation:0, time:1.5, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_01.beetham, {x:21.2, y:53.25, width:90.15, height:33.1, rotation:0, time:0.75, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_01.txt_fr_top, {x:50, y:20, width:114.35, height:18, time:1, delay:0.5, alpha:0, transition:"easeOutCubic"}); 
Tweener.addTween(Object(this).main_lab_01.txt_fr_bot, {x:0, y:69, width:116, height:23, alpha:0, time:1, delay:0.5, transition:"easeOutCubic"}); 
Tweener.addTween(this.main_lab_01.label_01, {x:2, y:14, time:1, delay:0, alpha:0, transition:"easeOutCubic"}); 
Tweener.addTween(Object(this).cloud_bg_2, {x:143, y:356, width:230, height:271.45, time:1, delay:0, alpha:0, transition:"easeOutCubic"}); 
} 

function doThis2(event:MouseEvent):void{ 
// group 2 
Tweener.addTween(Object(this).icon_group_02.block2, {x:244.05, y:117.85, width:116.55, height:98.45, time:1, rotation:6, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.block1, {x:305.55, y:141.35, width:88.3, height:72.6, time:1, rotation:4, delay:0.75, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bush1, {x:177.75, y:104, width:103.4, height:35.25, time:1, rotation:-1, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree1, {x:231.7, y:79.35, width:85.9, height:115.9, time:1.5, rotation:14, delay:0.75, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree2, {x:230.9, y:80.6, width:40.5, height:65.4, time:1, rotation:-7, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.chapel, {x:165.8, y:78.2, width:70.1, height:106.85, time:1.5, rotation:6, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bush2, {x:111.75, y:90.7, width:78.85, height:45.15, time:1, rotation:5, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree3, {x:131.55, y:71.9, width:43, height:58.65, time:1, rotation:18, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree4, {x:128.25, y:79.15, width:20, height:37.2, time:1.25, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.cloud2, {x:98.05, y:-6.75, width:55.5, height:37, time:1.25, rotation:0, delay:0.75, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.cloud1, {x:59.55, y:27.7, width:73.05, height:52.95, time:1.25, rotation:-9, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.block3, {x:52.85, y:100.1, width:79.9, height:72.5, time:1, rotation:0, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bush3, {x:2.3, y:161.5, width:115.55, height:84.7, time:1.25, rotation:-2, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bubble1, {x:0.5, y:79.3, width:61.3, height:54.3, time:1, rotation:14, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bubble2, {x:-31.45, y:76.95, width:55.4, height:60, time:1, rotation:17, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_02.txt_fr_top, {x:50, y:0, width:114.35, height:18, time:1, delay:0.25, alpha: 1, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_02.txt_fr_bot, {x:0, y:109, width:116, height:23, time:1, alpha:1, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(this.main_lab_02.label_02, {x:2, y:14, time:1, delay:1, alpha:1, transition:"easeOutCubic"}); 
Tweener.addTween(Object(this).cloud_bg_1, {x:330, y:0, width:360, height:249.9, time:1.5, delay:0.5, alpha:1, transition:"easeOutBounce"}); 
} 

function doThat2(event:MouseEvent):void{ 
// group 2 
Tweener.addTween(Object(this).icon_group_02.block2, {x:257.7, y:116, width:72.15, height:59.4, time:1, rotation:0, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.block1, {x:310, y:141.35, width:63.05, height:49.7, time:1, rotation:0, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bush1, {x:194.95, y:96, width:68.95, height:22.45, time:1, rotation:0, delay:1, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree1, {x:226.30, y:88.5, width:48.8, height:80.85, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree2, {x:223.85, y:80.05, width:17.8, height:33.15, time:1, rotation:0, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.chapel, {x:160.95, y:79.15, width:46.85, height:79.15, time:1, rotation:0, delay:0.75, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bush2, {x:113.35, y:89.8, width:49.35, height:25.2, time:1, rotation:0, delay:0.75, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree3, {x:133.25, y:77.5, width:17.85, height:33.25, time:1, rotation:0, delay:0.75, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.tree4, {x:124.45, y:83.1, width:13.6, height:25.3, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.cloud2, {x:125.65, y:19.25, width:25.5, height:17, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.cloud1, {x:86.25, y:43.75, width:41.2, height:26.35, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.block3, {x:70.25, y:97.80, width:55.65, height:50.5, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bush3, {x:28.35, y:137.2, width:68.35, height:48.95, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bubble1, {x:20.2, y:102.85, width:40.90, height:32.5, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_02.bubble2, {x:0, y:105.85, width:35.25, height:40.25, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_02.txt_fr_top, {x:50, y:20, width:114.35, height:18, time:1, delay:0.5, alpha:0, transition:"easeOutCubic"}); 
Tweener.addTween(Object(this).main_lab_02.txt_fr_bot, {x:0, y:69, width:116, height:23, alpha:0, time:1, delay:0.5, transition:"easeOutCubic"}); 
Tweener.addTween(this.main_lab_02.label_02, {x:2, y:14, time:1, delay:0, alpha:0, transition:"easeOutCubic"}); 
Tweener.addTween(Object(this).cloud_bg_1, {x:382.95, y:38.85, width:268, height:186, time:1, delay:0, alpha:0, transition:"easeOutCubic"}); 
} 

function doThis3(event:MouseEvent):void{ 
// group 3 
Tweener.addTween(Object(this).icon_group_03.cup, {x:8, y:-14, width:56, height:54.15, time:1, rotation:3, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_03.runner, {x:33, y:29, width:39.35, height:34.4, time:1.25, rotation:0, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_03.golf, {x:50.4, y:30.35, width:87.55, height:88.8, time:1, rotation:34.9, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_03.bike, {x:56.05, y:79.7, width:65.8, height:67.9, time:1.5, rotation:16.5, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_03.shower, {x:68.7, y:55.3, width:82.7, height:67.35, time:1, rotation:0.4, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).cloud_bg_3, {x:876.3, y:239.15, width:287, height:406.65, time:1, rotation:93.8, delay:0, alpha:1, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_03.txt_fr_top, {x:50, y:0, width:114.35, height:18, time:1, delay:0.25, alpha: 1, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).main_lab_03.txt_fr_bot, {x:0, y:109, width:116, height:23, time:1, alpha:1, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(this.main_lab_03.label_03, {x:2, y:14, time:1, delay:1, alpha:1, transition:"easeOutCubic"}); 

} 

function doThat3(event:MouseEvent):void{ 
// group 3 
Tweener.addTween(Object(this).icon_group_03.cup, {x:7, y:-3, width:45, height:43.45, time:1.25, rotation:0, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_03.runner, {x:29.45, y:29.95, width:27.85, height:24.35, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_03.golf, {x:20.70, y:33.9, width:60.6, height:63.15, time:1, rotation:-3.1, delay:0.5, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_03.bike, {x:50.8, y:96, width:42.2, height:44.75, time:1, rotation:0, delay:0, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).icon_group_03.shower, {x:60.1, y:63.8, width:80.45, height:68.25, time:1, rotation:-6.8, delay:0.25, transition:"easeOutBounce"}); 
Tweener.addTween(Object(this).cloud_bg_3, {x:849.55, y:273.85, width:233.6, height:333.95, rotation:93.8, time:1, delay:0, alpha:0, transition:"easeOutCubic"}); 
Tweener.addTween(Object(this).main_lab_03.txt_fr_top, {x:50, y:20, width:114.35, height:18, time:1, delay:0.5, alpha:0, transition:"easeOutCubic"}); 
Tweener.addTween(Object(this).main_lab_03.txt_fr_bot, {x:0, y:69, width:116, height:23, alpha:0, time:1, delay:0.5, transition:"easeOutCubic"}); 
Tweener.addTween(this.main_lab_03.label_03, {x:2, y:14, time:1, delay:0, alpha:0, transition:"easeOutCubic"}); 

} 

Object(this).segments.segment1.addEventListener(MouseEvent.CLICK, myBtnClicked1); 
Object(this).segments.segment2.addEventListener(MouseEvent.CLICK, myBtnClicked); 
Object(this).segments.segment3.addEventListener(MouseEvent.CLICK, myBtnClicked3); 


function myBtnClicked(e:MouseEvent):void { 
var url:String = "home.php"; 
var request:URLRequest = new URLRequest(url); 
try { 
navigateToURL(request, '_self'); 
} catch (e:Error) { 
trace("Error occurred!"); 
} 
} 

function myBtnClicked1(e:MouseEvent):void { 
var url:String = "home.php"; 
var request:URLRequest = new URLRequest(url); 
try { 
navigateToURL(request, '_self'); 
} catch (e:Error) { 
trace("Error occurred!"); 
} 
} 

function myBtnClicked3(e:MouseEvent):void { 
var url:String = "home.php"; 
var request:URLRequest = new URLRequest(url); 
try { 
navigateToURL(request, '_self'); 
} catch (e:Error) { 
trace("Error occurred!"); 
} 
} 
+0

菲爾,你能告訴我們一些代碼?從這個例子和你的描述中找出可能是什麼問題真的很難。大量的代碼是很好的 - 如果不是太長,你的整個班級都是如此。 – JcFx

回答

0

它從錯誤中看到我有時會觸發多個補間,通過滾動一個部分而另一個補間已經補間。

最好的解決方案是在開始新補丁時檢查是否有正在運行的補間,並且在播放新補丁前停止並倒帶它們,但需要更多的代碼。

在任何你做......的功能(doThis1等)的開始,試着加入:

// Remove all tweenings 
Tweener.removeTweens(target:object); 

根據http://hosted.zeh.com.br/tweener/docs/en-us/,這應該繼續執行停止任何現有的補間。

爲了讓你的對象重新回到起始位置,準備下一個補間變得更加棘手,因爲Tweener庫看起來並不容易倒回或重置補間。但是,如果您的do ...函數正在移動對象a,b,c,那麼我會在開始補間之前添加一些初始化代碼以將它們放在其起始位置,因此您的函數將會去:

// Do all of this for each object tweened in this function: 
{ 
    // Remove the current tween 
    Tweener.removeTweens(Object(this).icon_group_02.block2); 
    // Reposition the object in its starting blocks, if necessary: 
    Object(this).icon_group_02.block2.x = 100; // Or whatever... 
    // Now begin your tweens: 
    Tweener.addTween(Object(this).icon_group_02.block2 etc...) 
} 

的基本原則是要確保你開始下一吐溫之前收拾掉任何執行補間(以及任何錯位的對象)。

的使用GreenSock TweenLite的和TweenMax庫提供比中間人庫的更多更多的控制,並可以很容易地取消,回滾和羣補間:http://www.greensock.com/v11/

+0

謝謝JcFx。我需要這些補間同時運行,以便在你看到我的意思時,一邊向前,另一邊反向。我的代碼是否貼出了幫助? –

+0

我注意到你創建它們時並沒有存儲對你的補間的引用。如果你已經有一個補間運行,並且你再次翻轉按鈕,你可能會在同一個對象上啓動第二個補間,這可能會導致各種各樣的冗餘行爲。你最好的選擇是將補間存儲在變量中,並取消在你使用同一個目標啓動一個新變量之前所做的任何動作。一次補間多個項目沒有問題,它是多個衝突補間,通常會導致這類問題。 – JcFx

+0

謝謝JcFx。你能否給我舉個例子說明我可能會這樣做?正如你可以從我的代碼中看出的那樣,我是一個初學者,對於這種類型的東西! –