FlashAndTheCity 2011

Special this week for our subscribers – get discount of 30% off FlashAndTheCity 2011, use “TAKE30” during checkout on all tickets.

Flash and the City is a four-day technology event, beginning June 9 with a day of workshops, and includes a 3-day, June 10-12, marathon-style conference focusing on a variety of technologies.

This year the conference will be segmented to include more topics that encompass a vast majority of technologies directly impacting web and mobile, not simply limited to Flash. More specifically, the conference has a single theme for each of the three days. The three “themes of the day” are UX/UI, mobile, and HTML5.

Flash and the City is almost here, make sure you add our event to your calendar, book all yourtickets, and don’t miss out what is to be a truly great technology conference right in the heart of New York.

This is a 3-day conference taking place June 10-12, with a day of pre-conference workshops on June 9 conveniently scheduled in the same venue.

** Also make sure you sign up for the free WP7 workshop. You will not want to miss it and it’s free! **

Advertisements

myName

Vodpod videos no longer available.

import com.greensock.*;
import com.greensock.easing.*;

var txt:TextField = new TextField();
addChild(txt);
txt.embedFonts = true;
txt.defaultTextFormat = new TextFormat(“Arial”, 36);
txt.text = “why does this only work with Arial?”;
txt.autoSize = TextFieldAutoSize.LEFT;
txt.x = 100;
txt.y = -200;
TweenLite.to(txt, 2, {y:300, rotation:360});

DragDrop

Drop items in buckets ….

Vodpod videos no longer available.

So this is on the main time line….

var clutter:Array = [leafbug1, leafbug2, leafbug3, leafbug4, leaf1, leaf2, leaf3, leaf4];

function assignTargets():void
{
var instanceName:String;

for(var i:uint = 0; i < clutter.length; i++)
{
instanceName = clutter[i].name;
if(instanceName.indexOf(“bug”) != -1)
{
clutter[i].target = bugBkt_mc;
}
else
{
clutter[i].target = leafBkt_mc;
}
}
}

assignTargets();

And this is the Class …

package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;

public class DragDrop extends MovieClip
{
public var target:MovieClip;
private var originalX:Number;
private var originalY:Number;
public function DragDrop()
{
originalX = this.x;
originalY = this.y;
this.addEventListener(MouseEvent.MOUSE_DOWN, drag);
}
private function drag(event:MouseEvent):void
{
this.startDrag();
this.parent.addChild(this);
this.addEventListener(MouseEvent.MOUSE_UP, drop);
}
private function drop(event:MouseEvent):void{
this.stopDrag();
this.removeEventListener(MouseEvent.MOUSE_UP, drop);

if(this.hitTestObject(target))
{
this.visible = false;
}
else
{
this.x = originalX;
this.y = originalY;
}
}
}
}

XML

I am trying to Load a title and a description through XML. The example we have looks like this:

<![CDATA[
float head
– 2008
]]>

But looking at this (and the Flash file) – I can not tell how to distinguish between two text fields.

UPdate

So I posted my new bluedawg site live, But I had several problems combining the action script we have learned with time line navigation. So in the end I had to do it the way I knew how instead of using the new stuff we have learned – especially since it’s so hard to get help.

Pest_Patrol_Demo Updated

Needs perhapse some Arrays? Will have to do some experimenting.

Vodpod videos no longer available.

import com.greensock.TweenLite;
import com.greensock.easing.*;

bg.sun.play();
inst_mc.play();

var cultChild:Boolean = false;
var spray1Child:Boolean = false;
var beerChild:Boolean = false;
var bugChild:Boolean = false;
var spray2Child:Boolean = false;
var trapChild:Boolean = false;

var cult:MovieClip = new Cult();
var spray1:MovieClip = new sprayBtl1();
var beer:MovieClip = new Beer();
var lb:MovieClip = new ladyBugs();
var lb2:MovieClip = new ladyBugs();
var spray2:MovieClip = new sprayBtl();
var trap:MovieClip = new Trap_mc();

drop1.visible = false;
drop2.visible = false;
drop3.visible = false;
drop4.visible = false;
drop5.visible = false;
drop6.visible = false;
drop7.visible = false;
groundhog.visible=false;
bunny.visible=false;
hose.visible = false;

dogBtn.buttonMode=true;
cultBtn.buttonMode=true;
btn1.buttonMode=true;
btn2.buttonMode=true;
btn3.buttonMode=true;
btn4.buttonMode=true;
btn5.buttonMode=true;
btn6.buttonMode=true;
btn7.buttonMode=true;
btn8.buttonMode=true;

function resetWeeds(evt:Event):void {
weed1.gotoAndStop(“grow”);
weed2.gotoAndStop(“grow”);
weed3.gotoAndStop(“grow”);
weed4.gotoAndStop(“grow”);
}

function resetSlugs(evt:Event):void {
slug1.gotoAndStop(“start”);
slug2.gotoAndStop(“start”);
slug3.gotoAndStop(“start”);
slug4.gotoAndStop(“start”);
slug5.gotoAndStop(“start”);
slug6.gotoAndStop(“start”);
slug1.x = 917;
slug2.x = 984;
slug3.x = 1070;
slug4.x = -20;
slug5.x = -96;
slug6.x = -177;
}

function helpWin(evt:MouseEvent):void {
inst_mc.visible=true;
inst_mc.play();
}

groundhog.addEventListener(MouseEvent.CLICK, relocateWin);

drop1.addEventListener(MouseEvent.CLICK, onClickDrop1);
drop2.addEventListener(MouseEvent.CLICK, onClickDrop2);
drop3.addEventListener(MouseEvent.CLICK, onClickDrop3);
drop4.addEventListener(MouseEvent.CLICK, onClickDrop4);
drop5.addEventListener(MouseEvent.CLICK, onClickDrop5);
drop6.addEventListener(MouseEvent.CLICK, onClickDrop6);
drop7.addEventListener(MouseEvent.CLICK, onClickDrop7);
btn1.addEventListener(MouseEvent.CLICK, resetWeeds);
btn2.addEventListener(MouseEvent.CLICK, playAphids);
btn3.addEventListener(MouseEvent.CLICK, onClickBeetles);
btn4.addEventListener(MouseEvent.CLICK, playSlugs);
btn4.addEventListener(MouseEvent.CLICK, resetSlugs);
btn5.addEventListener(MouseEvent.CLICK, onClickCrowFly);
btn6.addEventListener(MouseEvent.CLICK, onClickBunny);
btn7.addEventListener(MouseEvent.CLICK, onClickDeer);
btn8.addEventListener(MouseEvent.CLICK, onClickGH);

cultBtn.addEventListener(MouseEvent.CLICK, onClickCult);
beerBtn.addEventListener(MouseEvent.CLICK, onClickBeer);
LBBtn.addEventListener(MouseEvent.CLICK, onClickLB);
spray1Btn.addEventListener(MouseEvent.CLICK, onClickSpray1);
spray2Btn.addEventListener(MouseEvent.CLICK, onClickSpray2);
hose_btn1.addEventListener(MouseEvent.CLICK, onClickHose1);
hose.addEventListener(MouseEvent.CLICK, onClickDeer);
scarecrow_btn.addEventListener(MouseEvent.MOUSE_DOWN, onSCDown);
hose.addEventListener(MouseEvent.MOUSE_DOWN, onHoseDown);
hose.addEventListener(MouseEvent.MOUSE_UP, onHoseUp);
scarecrow.addEventListener(MouseEvent.ROLL_OUT, onSCOut);
dog.addEventListener(MouseEvent.CLICK, onClickDog);
dogBtn.addEventListener(MouseEvent.CLICK, onClickDog);
relocateNavBtn.addEventListener(MouseEvent.CLICK, trapGH);
HelpBtn.addEventListener(MouseEvent.CLICK,helpWin);

//BUTTONS

cultBtn.addEventListener(MouseEvent.MOUSE_OVER, onOver);
cultBtn.addEventListener(MouseEvent.MOUSE_OUT, onOut);
spray1Btn.addEventListener(MouseEvent.MOUSE_OVER, onOver);
spray1Btn.addEventListener(MouseEvent.MOUSE_OUT, onOut);
beerBtn.addEventListener(MouseEvent.MOUSE_OVER, onOver);
beerBtn.addEventListener(MouseEvent.MOUSE_OUT, onOut);
LBBtn.addEventListener(MouseEvent.MOUSE_OVER, onOver);
LBBtn.addEventListener(MouseEvent.MOUSE_OUT, onOut);
spray2Btn.addEventListener(MouseEvent.MOUSE_OVER, onOver);
spray2Btn.addEventListener(MouseEvent.MOUSE_OUT, onOut);
scarecrow_btn.addEventListener(MouseEvent.MOUSE_OVER, onOver);
scarecrow_btn.addEventListener(MouseEvent.MOUSE_OUT, onOut);
dogBtn.addEventListener(MouseEvent.MOUSE_OVER, onOver);
dogBtn.addEventListener(MouseEvent.MOUSE_OUT, onOut);
hose_btn1.addEventListener(MouseEvent.MOUSE_OVER, onOver);
hose_btn1.addEventListener(MouseEvent.MOUSE_OUT, onOut);
relocateNavBtn.addEventListener(MouseEvent.MOUSE_OVER, onOver);
relocateNavBtn.addEventListener(MouseEvent.MOUSE_OUT, onOut);

function onOver(evt:MouseEvent):void {
evt.currentTarget.gotoAndStop(“over”);
}

function onOut(evt:MouseEvent):void {
evt.currentTarget.gotoAndStop(“out”);
}

function onClickCult(evt:MouseEvent):void {
drop1.visible = true;
cultChild = true;
inst_mc.visible = false;
addChild(cult);
addEventListener (Event.ENTER_FRAME, onLoopCult);
function onLoopCult(evt:Event):void {
cult.x = mouseX+30;
cult.y = mouseY
}
}

function onClickBeetles(evt:MouseEvent):void {
addEventListener(Event.ENTER_FRAME, onBeetlesLoop);

function onBeetlesLoop(evt:Event):void {
Beetles.x+=4;
if(Beetles.x>=1545) {
removeEventListener(Event.ENTER_FRAME, onBeetlesLoop);
}
}
}

function onClickSpray1(evt:MouseEvent):void {
drop2.visible = true;
spray1Child = true;
addChild(spray1);
addEventListener (Event.ENTER_FRAME, onLoopSpray1);
function onLoopSpray1(evt:Event):void {
spray1.x = mouseX;
spray1.y = mouseY + 50;
}
}

function onClickBeer(evt:MouseEvent):void {
drop3.visible = true;
beerChild = true;
addChild(beer);
addEventListener (Event.ENTER_FRAME, onLoopBeer);
function onLoopBeer(evt:Event):void {
beer.x = mouseX + 30;
beer.y = mouseY
}
}

function onClickLB(evt:MouseEvent):void {
drop4.visible = true;
bugChild = true;
addChild(lb);
addEventListener (Event.ENTER_FRAME, onLoopLB);
function onLoopLB(evt:Event):void {
lb.x = mouseX+30;
lb.y = mouseY
}
}

function onClickSpray2(evt:MouseEvent):void {
drop5.visible = true;
spray2Child = true;
addChild(spray2);
addEventListener (Event.ENTER_FRAME, onLoopSpray);
function onLoopSpray(evt:Event):void {
spray2.x = mouseX;
spray2.y = mouseY + 50;
}
}

function onClickCrowFly(evt:MouseEvent):void {
crow1.play();
crow2.play();
}

function onClickDrop1(evt:MouseEvent):void {
removeChild(cult);
drop1.visible = false;
}
function onClickDrop2(evt:MouseEvent):void {
removeChild(spray1);
drop2.visible = false;
}
function onClickDrop3(evt:MouseEvent):void {
removeChild(beer);
drop3.visible = false;
}
function onClickDrop4(evt:MouseEvent):void {
removeChild(lb);
bugChild = false;
drop4.visible = false;
}
function onClickDrop5(evt:MouseEvent):void {
removeChild(spray2);
drop5.visible = false;
}
function onClickDrop6(evt:MouseEvent):void {
removeChild(trap);
drop6.visible = false;
}

function onClickDrop7(evt:MouseEvent):void {
hose.visible = false;
drop7.visible = false;
}

function onSCDown(evt:MouseEvent):void {
scarecrow.play();
crow1.play();
crow2.play();
}

function onSCOut(evt:MouseEvent):void {
scarecrow.stop();
}

function onClickDog(evt:MouseEvent):void {
var dog:MovieClip = new Dog();
dog.x = 260;
dog.y = 140;
deerB.DeerC.gotoAndStop(1);
dog.play();
crow1.play();
crow2.play();
bunny.play();
if (groundhog.visible==true) {
groundhog.gotoAndPlay(1);
}
}

function onClickHose1(evt:MouseEvent):void {
hose.visible = true;
drop7.visible = true;
}

function onHoseDown(evt:MouseEvent):void {
hose.gotoAndPlay(“spray”);
}

function onHoseUp(evt:MouseEvent):void {
hose.gotoAndPlay(“right”);
}

function trapGH(evt:MouseEvent):void {
drop6.visible = true;
trapChild = true;
addChild(trap);
addEventListener (Event.ENTER_FRAME, onLoopTrap);
function onLoopTrap(evt:Event):void {
trap.x = mouseX + 100;
trap.y = mouseY
}
}

function relocateWin(evt:MouseEvent):void {
var relocate:MovieClip = new Relocate();
addChild(relocate);
relocate.x = 460;
relocate.y = 270;
removeChild(trap);
drop6.visible = false;
groundhog.visible = false
}

function onClickGH(evt:MouseEvent):void {
groundhog.visible=true;
groundhog.play();
}

function onClickBunny(evt:MouseEvent):void {
bunny.visible=true;
bunny.play();
}

function onClickDeer(evt:MouseEvent):void {
deerB.play();
deerB.DeerC.gotoAndPlay(1);
}

weed1.addEventListener(MouseEvent.CLICK, onClick);
weed2.addEventListener(MouseEvent.CLICK, onClick);
weed3.addEventListener(MouseEvent.CLICK, onClick);
weed4.addEventListener(MouseEvent.CLICK, onClick);

//SLUGS
slug1.addEventListener(MouseEvent.CLICK, onClick);
slug2.addEventListener(MouseEvent.CLICK, onClick);
slug3.addEventListener(MouseEvent.CLICK, onClick);
slug4.addEventListener(MouseEvent.CLICK, onClick);
slug5.addEventListener(MouseEvent.CLICK, onClick);
slug6.addEventListener(MouseEvent.CLICK, onClick);

//VEGIES
tomatoe1.addEventListener(MouseEvent.CLICK, onClick);
tomatoe2.addEventListener(MouseEvent.CLICK, onClick);
tomatoe3.addEventListener(MouseEvent.CLICK, onClick);
tomatoe4.addEventListener(MouseEvent.CLICK, onClick);
oregano1.addEventListener(MouseEvent.CLICK, onClick);
oregano2.addEventListener(MouseEvent.CLICK, onClick);
oregano3.addEventListener(MouseEvent.CLICK, onClick);
oregano4.addEventListener(MouseEvent.CLICK, onClick);
oregano5.addEventListener(MouseEvent.CLICK, onClick);
oregano6.addEventListener(MouseEvent.CLICK, onClick);
carrot1.addEventListener(MouseEvent.CLICK, onClick);
carrot2.addEventListener(MouseEvent.CLICK, onClick);
carrot3.addEventListener(MouseEvent.CLICK, onClick);
carrot4.addEventListener(MouseEvent.CLICK, onClick);
onion1.addEventListener(MouseEvent.CLICK, onClick);
onion2.addEventListener(MouseEvent.CLICK, onClick);
scallion1.addEventListener(MouseEvent.CLICK, onClick);
scallion2.addEventListener(MouseEvent.CLICK, onClick);
peas1.addEventListener(MouseEvent.CLICK, onClick);
peas2.addEventListener(MouseEvent.CLICK, onClick);
basil1.addEventListener(MouseEvent.CLICK, onClick);
basil2.addEventListener(MouseEvent.CLICK, onClick);
lettuce1.addEventListener(MouseEvent.CLICK, onClick);
lettuce2.addEventListener(MouseEvent.CLICK, onClick);
lettuce3.addEventListener(MouseEvent.CLICK, onClick);
lettuce4.addEventListener(MouseEvent.CLICK, onClick);
strawberry1.addEventListener(MouseEvent.CLICK, onClick);
strawberry2.addEventListener(MouseEvent.CLICK, onClick);
strawberry3.addEventListener(MouseEvent.CLICK, onClick);
strawberry4.addEventListener(MouseEvent.CLICK, onClick);
cabbage1.addEventListener(MouseEvent.CLICK, onClick);
cabbage2.addEventListener(MouseEvent.CLICK, onClick);
cabbage3.addEventListener(MouseEvent.CLICK, onClick);
cabbage4.addEventListener(MouseEvent.CLICK, onClick);
cabbage5.addEventListener(MouseEvent.CLICK, onClick);
cabbage6.addEventListener(MouseEvent.CLICK, onClick);

function onClick(evt:Event):void {
inst_mc.visible = false;
evt.currentTarget.play();
if(bugChild == true) {
evt.currentTarget.gotoAndStop(“ladyBugs”);
}
}

Working hard to get a demo done by Monday…

Vodpod videos no longer available.

bg.sun.play();

inst_mc.play();
groundhog.visible=false;
hose.visible = false;

dogBtn.buttonMode=true;
cultBtn.buttonMode=true;

dog.addEventListener(MouseEvent.CLICK, onClickDog);
dogBtn.addEventListener(MouseEvent.CLICK, onClickDog);
relocateNavBtn.addEventListener(MouseEvent.CLICK, relocateWin);
HelpBtn.addEventListener(MouseEvent.CLICK,helpWin);

function helpWin(evt:MouseEvent):void {
inst_mc.visible=true;
inst_mc.play();
}

cultBtn.addEventListener(MouseEvent.CLICK, onClickCult);
cultBtn.addEventListener(MouseEvent.MOUSE_OVER, onCultOver);
cultBtn.addEventListener(MouseEvent.MOUSE_OUT, onCultOut);
spray2.addEventListener(MouseEvent.CLICK, onClickSpray2);
//sprayBtl.addEventListener(MouseEvent.CLICK, onClickSpray);
hose_btn1.addEventListener(MouseEvent.CLICK, onClickHose1);
//hose_btn2.addEventListener(MouseEvent.CLICK, onClickHose2);
btn5.addEventListener(MouseEvent.CLICK, onClickGH);
btn6.addEventListener(MouseEvent.CLICK, onClickDeer);
//hose.addEventListener(MouseEvent.CLICK, onClickDeer);
scarecrow_btn.addEventListener(MouseEvent.MOUSE_DOWN, onSCDown);
hose.addEventListener(MouseEvent.MOUSE_DOWN, onHoseDown);
//hose.addEventListener(MouseEvent.MOUSE_UP, onHoseUp);
scarecrow.addEventListener(MouseEvent.ROLL_OUT, onSCOut);

function onCultOver(evt:MouseEvent):void {
var ct:ColorTransform = new ColorTransform();
ct.greenMultiplier = 100;
ct.greenOffset = -10;
evt.currentTarget.btnBg.transform.colorTransform = ct;
}

function onCultOut(evt:MouseEvent):void {
evt.currentTarget.btnBg.transform.colorTransform = new ColorTransform();
}

function onClickCult(evt:MouseEvent):void {
Mouse.hide();
inst_mc.visible = false;
var cult:MovieClip = new Cult();
addChild(cult);
addEventListener (Event.ENTER_FRAME, onLoopCult);
function onLoopCult(evt:Event):void {
cult.x = mouseX
cult.y = mouseY
}
}
function onClickBeer(evt:MouseEvent):void {
Mouse.hide();
var beer:MovieClip = new Beer();
addChild(beer);
addEventListener (Event.ENTER_FRAME, onLoopBeer);
function onLoopBeer(evt:Event):void {
beer.x = mouseX
beer.y = mouseY
}
}

function onClickLadyBugs(evt:MouseEvent):void {
Mouse.hide();
var bugs:MovieClip = new ladyBugs();
addChild(bugs);
addEventListener (Event.ENTER_FRAME, onLoopBugs);
function onLoopBugs(evt:Event):void {
bugs.x = mouseX
bugs.y = mouseY
}
}

function onClickSpray2(evt:MouseEvent):void {
Mouse.hide();
var spray:MovieClip = new sprayBtl();
addChild(spray);
addEventListener (Event.ENTER_FRAME, onLoopSpray);
function onLoopSpray(evt:Event):void {
spray.x = mouseX
spray.y = mouseY
}
}

function onSCDown(evt:MouseEvent):void {
scarecrow.play();
}

function onSCOut(evt:MouseEvent):void {
scarecrow.stop();
}

function onClickDog(evt:MouseEvent):void {
var dog:MovieClip = new Dog();
dog.x = 260;
dog.y = 140;
deerB.DeerC.gotoAndStop(1);
dog.play();
crowAnim.play();
if (groundhog.visible==true) {
groundhog.gotoAndPlay(1);
}
}

function onClickHose1(evt:MouseEvent):void {
hose.visible = true;
}

function onHoseDown(evt:MouseEvent):void {
hose.gotoAndPlay(“spray”);
}

function onHoseUp(evt:MouseEvent):void {
hose.gotoAndPlay(“right”);
}

function relocateWin(evt:MouseEvent):void {
var relocate:MovieClip = new Relocate();
addChild(relocate);
relocate.x = 460;
relocate.y = 270;
}

function onClickGH(evt:MouseEvent):void {
groundhog.visible=true;
groundhog.play();
}

function onClickDeer(evt:MouseEvent):void {
deerB.play();
deerB.DeerC.gotoAndPlay(1);
}

weed1.addEventListener(MouseEvent.CLICK, onClick);
weed2.addEventListener(MouseEvent.CLICK, onClick);
weed3.addEventListener(MouseEvent.CLICK, onClick);
weed4.addEventListener(MouseEvent.CLICK, onClick);

//VEGIES
tomatoe1.addEventListener(MouseEvent.CLICK, onClick);
tomatoe2.addEventListener(MouseEvent.CLICK, onClick);
tomatoe3.addEventListener(MouseEvent.CLICK, onClick);
tomatoe4.addEventListener(MouseEvent.CLICK, onClick);
oregano1.addEventListener(MouseEvent.CLICK, onClick);
oregano2.addEventListener(MouseEvent.CLICK, onClick);
oregano3.addEventListener(MouseEvent.CLICK, onClick);
oregano4.addEventListener(MouseEvent.CLICK, onClick);
oregano5.addEventListener(MouseEvent.CLICK, onClick);
oregano6.addEventListener(MouseEvent.CLICK, onClick);
carrot1.addEventListener(MouseEvent.CLICK, onClick);
carrot2.addEventListener(MouseEvent.CLICK, onClick);
carrot3.addEventListener(MouseEvent.CLICK, onClick);
carrot4.addEventListener(MouseEvent.CLICK, onClick);
onion1.addEventListener(MouseEvent.CLICK, onClick);
onion2.addEventListener(MouseEvent.CLICK, onClick);
scallion1.addEventListener(MouseEvent.CLICK, onClick);
scallion2.addEventListener(MouseEvent.CLICK, onClick);
peas1.addEventListener(MouseEvent.CLICK, onClick);
peas2.addEventListener(MouseEvent.CLICK, onClick);
basil1.addEventListener(MouseEvent.CLICK, onClick);
basil2.addEventListener(MouseEvent.CLICK, onClick);
lettuce1.addEventListener(MouseEvent.CLICK, onClick);
lettuce2.addEventListener(MouseEvent.CLICK, onClick);
lettuce3.addEventListener(MouseEvent.CLICK, onClick);
lettuce4.addEventListener(MouseEvent.CLICK, onClick);
strawberry1.addEventListener(MouseEvent.CLICK, onClick);
strawberry2.addEventListener(MouseEvent.CLICK, onClick);
strawberry3.addEventListener(MouseEvent.CLICK, onClick);
strawberry4.addEventListener(MouseEvent.CLICK, onClick);
cabbage1.addEventListener(MouseEvent.CLICK, onClick);
cabbage2.addEventListener(MouseEvent.CLICK, onClick);
cabbage3.addEventListener(MouseEvent.CLICK, onClick);
cabbage4.addEventListener(MouseEvent.CLICK, onClick);
cabbage5.addEventListener(MouseEvent.CLICK, onClick);
cabbage6.addEventListener(MouseEvent.CLICK, onClick);

function onClick(evt:Event):void {
inst_mc.visible = false;
evt.currentTarget.play();
}

/*//SOUND

var isPlaying:Boolean = new Boolean();
var pausePosition:Number = new Number();
var soundClip:Sound = new Sound();
var sndChannel:SoundChannel = new SoundChannel();

soundClip.load(new URLRequest(“av038.wav”));
soundClip.addEventListener(Event.COMPLETE, onComplete, false, 0, true);

controller.addEventListener(MouseEvent.MOUSE_DOWN, btnPressController, false, 0, true);

function onComplete(evt:Event):void {

}

function btnPressController(evt:MouseEvent):void
{
switch(isPlaying)
{
case true:
controller.gotoAndStop(“off”);
pausePosition = sndChannel.position;
sndChannel.stop();
isPlaying = false;
break;
case false:
controller.gotoAndStop(“on”);
sndChannel = soundClip.play(0,int.MAX_VALUE);
isPlaying = true;
break;
}
}*/

EC Banner

Vodpod videos no longer available.

Still need to check for child – then remove if child exists. Found a workaround for now….
import com.greensock.TweenLite;
import com.greensock.easing.*;

var food:MovieClip = new(theFood);
var wine:MovieClip = new(theWine);
var chefs:MovieClip = new(theChefs);
var fun:MovieClip = new(theFun);

var one:Number=764;
var two:Number=236;
slider.addChild(wine);

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void {
var thisPos:Number = (Math.round(this.x));
this.x-=1;

if (thisPos==490) {
food1_mc.play();
wine2_mc.gotoAndStop(1);
slider.x = wine1_mc.x;
TweenLite.to(slider, 3, {x:food1_mc.x, ease:Strong.easeOut});
slider.removeChild(wine);
slider.addChild(food);

} else if (thisPos == 355) {
food1_mc.play();
fun1_mc.play();
TweenLite.to(slider, 3, {x:fun1_mc.x, ease:Strong.easeOut});
slider.removeChild(food);
slider.addChild(fun);

} else if (thisPos == 230) {
fun1_mc.play();
chefs1_mc.play();
TweenLite.to(slider, 3, {x:chefs1_mc.x, ease:Strong.easeOut});
slider.removeChild(fun);
slider.addChild(chefs);

} else if (thisPos == 105) {
chefs1_mc.play();
wine2_mc.play();
TweenLite.to(slider, 3, {x:wine2_mc.x, ease:Strong.easeOut});
slider.removeChild(chefs);
slider.addChild(wine);

} else if (thisPos == -20) {
wine2_mc.play();
food2_mc.play();
TweenLite.to(slider, 3, {x:food2_mc.x, ease:Strong.easeOut});
slider.removeChild(wine);
slider.addChild(food);

} else if (thisPos == -145) {
food2_mc.play();
fun1_mc.play();
TweenLite.to(slider, 3, {x:fun1_mc.x, ease:Strong.easeOut});
slider.removeChild(food);
slider.addChild(fun);

} else if (thisPos == -270) {
fun1_mc.play();
chefs2_mc.play();
TweenLite.to(slider, 3, {x:chefs2_mc.x, ease:Strong.easeOut});
slider.removeChild(fun);
slider.addChild(chefs);

} else if (thisPos == -395) {
chefs2_mc.play();
wine2_mc.play();
TweenLite.to(slider, 3, {x:wine2_mc.x, ease:Strong.easeOut});
slider.removeChild(chefs);
slider.addChild(wine);

} else if (this.x<=-488) {
this.x=498;
}

}