AS3 Tween rollover affects other elements on the stage

823 Views Asked by At

I have used as3 tweener to create the following animation.

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

When you rollover a section of the circle that circle animates and a caption is revealed. When you rollout it animates back to it's initial state.

It all works fine but then for some reason at random when you rollover one section the text for a completely different section appears!!

I don't know how it happens and I can't "make" it happen so I can't figure out why it's happening. All I can do is constantly move my mouse over the sections until the glitch occurs.

Can anyone help please?

Here is a sample of my code, sorry it's a bit long!!

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!");
}
}
1

There are 1 best solutions below

6
Jude Fisher On

It looks to me from the error that you sometimes trigger more than one tween, by rolling over one section while another is already tweening.

The best solution is to check for any running tweens when you begin a new one, and stop and rewind them before playing the new one, but that takes a bit more code.

At the beginning of any of your do... functions (doThis1, etc.), try adding:

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

According to http://hosted.zeh.com.br/tweener/docs/en-us/, this should stop any existing tweens from continuing to execute.

To get your objects back in their start positions ready for the next tween is trickier, as the Tweener library doesn't seem to make it easy to rewind or reset a tween.

You might try this, though: if your do... function is moving objects a,b,c then I would add some initialization code to put them at their start locations before you begin your tweens, so your function would go:

// 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...)
}

The basic principle is to make sure you tidy away any executing tweens (and any misplaced objects) before beginning your next tween.

The Greensock TweenLite and TweenMax libraries offer more much more control than the Tweener library, and make it easy to cancel, roll-back, and group tweens: http://www.greensock.com/v11/