Jump to content
Search Community

chefkeifer

Members
  • Posts

    129
  • Joined

  • Last visited

Everything posted by chefkeifer

  1. so for instance i have 15 buttons (which i do)...and i have the out switch statement that tween Fades (alpha)content out...i would then need to make 15 separate functions to removeChild?
  2. how do i not nest them..nesting is new term to me..
  3. Hey, I am having an issue of if the user moves the mouse too fast over the buttons the content shows up but does not go away...is it because its taking too long for the function to complete. is there a way around this to have a smooth transistion. here is some snippet of code function over(event:MouseEvent):void{ switch(event.currentTarget.name){ case"btn_welcome": content1 = new welcome(); addChild(content1); content1.alpha = 0; var over1:TimelineMax = new TimelineMax(); over1.insert(TweenMax.to(content1, .1, {scaleX:0, scaleY:0})); over1.append(TweenMax.to(content1, .5, {scaleX:1, scaleY:1, alpha:1})); setChildIndex(menu,numChildren - 1); break; case"btn_dragStrip": content2 = new dragStrip(); addChild(content2); content2.alpha = 0; var over2:TimelineMax = new TimelineMax(); over2.insert(TweenMax.to(content2, .1, {scaleX:0, scaleY:0})); over2.append(TweenMax.to(content2, .5, {scaleX:1, scaleY:1, alpha:1})); setChildIndex(menu,numChildren - 1); break; //*****====================================================***** function out(event:MouseEvent):void{ switch(event.currentTarget.name){ case"btn_welcome": TweenMax.to(content1, 1, {alpha:0, onComplete:onFinish1}); function onFinish1():void{ removeChild(content1); } break; case"btn_dragStrip": TweenMax.to(content2, 1, {alpha:0, onComplete:onFinish2}); function onFinish2():void{ removeChild(content2); } break; here is a link to the swf so you can see what i am talking about. http:// http://www.carolinaadventureworld.net/homePage.swf
  4. Thanks...now i can apply to that to my other projects.
  5. so how do I removed the contentLoader with a tween.
  6. ok i changed my code up a bit..everything seems to be working fine but it doesnt seem the removeChild tweens..all the addChild tween in.. //*****====================================================***** var contentLoader:Loader = new Loader(); var swf:MovieClip; var destX:Number = 0; var destY:Number = 325; //*****====================================================***** var defaultSWF:URLRequest = new URLRequest("homePage.swf"); //*****====================================================***** contentLoader.load(defaultSWF); addChild(contentLoader); var fadeIn:TimelineMax = new TimelineMax(); fadeIn.append(TweenMax.to(contentLoader, .1, {alpha:0})); fadeIn.append(TweenMax.to(contentLoader, .1, {x:destX, y:destY})); fadeIn.append(TweenMax.to(contentLoader, 2, {alpha:1})); //*****====================================================***** function clicked(event:MouseEvent):void { TweenMax.to(contentLoader, 1, {alpha:0}); removeChild(contentLoader); var newSWFRequest:URLRequest = new URLRequest(event.target.name + ".swf"); contentLoader.load(newSWFRequest); addChild(contentLoader); var fadeIn2:TimelineMax = new TimelineMax(); fadeIn2.append(TweenMax.to(contentLoader, .1, {alpha:0})); fadeIn2.append(TweenMax.to(contentLoader, .1, {x:destX, y:destY})); fadeIn2.append(TweenMax.to(contentLoader, 3, {alpha:1})); } //*****====================================================*****
  7. by the way. I just donated another $100.00 to move myself up to the Shockingly Green member
  8. do you know of an example of or some sort of tutorial on the proper way to tween multiple external swf's i can't seem to find any..
  9. here is the code. I would attached the fla but it was too big. this has been one issue i have never been able to fix over the past year. I have had to just use no tweening in and out my content. I appreciate your help!!! import com.greensock.*; import com.greensock.plugins.*; import com.greensock.easing.*; import com.google.analytics.AnalyticsTracker; import com.google.analytics.GATracker; TweenPlugin.activate([Physics2DPlugin]); //----------------------------------------------- var tracker:AnalyticsTracker = new GATracker( this, "UA-11181582-1", "AS3", false ); //----------------------------------------------- commercial.buttonMode = true; commercial.btn_txt.text = "Commerical Relocation..." commercial.addEventListener(MouseEvent.MOUSE_OVER, over); commercial.addEventListener(MouseEvent.MOUSE_OUT, out); commercial.addEventListener(MouseEvent.CLICK, clicked); //----------------------------------------------- residential.buttonMode = true; residential.btn_txt.text = "Residential Relocation..." residential.addEventListener(MouseEvent.MOUSE_OVER, over); residential.addEventListener(MouseEvent.MOUSE_OUT, out); residential.addEventListener(MouseEvent.CLICK, clicked); //----------------------------------------------- buyFurniture.buttonMode = true; buyFurniture.btn_txt.text = "Buy Furniture..." buyFurniture.addEventListener(MouseEvent.MOUSE_OVER, over); buyFurniture.addEventListener(MouseEvent.MOUSE_OUT, out); buyFurniture.addEventListener(MouseEvent.CLICK, clicked); //----------------------------------------------- sellFurniture.buttonMode = true; sellFurniture.btn_txt.text = "Sell Furniture..." sellFurniture.addEventListener(MouseEvent.MOUSE_OVER, over); sellFurniture.addEventListener(MouseEvent.MOUSE_OUT, out); sellFurniture.addEventListener(MouseEvent.CLICK, clicked); //----------------------------------------------- fileMoving.buttonMode = true; fileMoving.btn_txt.text = "File Moving..." fileMoving.addEventListener(MouseEvent.MOUSE_OVER, over); fileMoving.addEventListener(MouseEvent.MOUSE_OUT, out); fileMoving.addEventListener(MouseEvent.CLICK, clicked); //----------------------------------------------- shredding.buttonMode = true; shredding.btn_txt.text = "Document Shredding..." shredding.addEventListener(MouseEvent.MOUSE_OVER, over); shredding.addEventListener(MouseEvent.MOUSE_OUT, out); shredding.addEventListener(MouseEvent.CLICK, clicked); //----------------------------------------------- storage.buttonMode = true; storage.btn_txt.text = "Storage Facilities..." storage.addEventListener(MouseEvent.MOUSE_OVER, over); storage.addEventListener(MouseEvent.MOUSE_OUT, out); storage.addEventListener(MouseEvent.CLICK, clicked); //----------------------------------------------- cubicle.buttonMode = true; cubicle.btn_txt.text = "Cubicle Installation..." cubicle.addEventListener(MouseEvent.MOUSE_OVER, over); cubicle.addEventListener(MouseEvent.MOUSE_OUT, out); cubicle.addEventListener(MouseEvent.CLICK, clicked); //----------------------------------------------- menu.about.addEventListener(MouseEvent.CLICK, clicked); menu.faq.addEventListener(MouseEvent.CLICK, clicked); menu.movePlanning.addEventListener(MouseEvent.CLICK, clicked); menu.moveInstructions.addEventListener(MouseEvent.CLICK, clicked); menu.contact.addEventListener(MouseEvent.CLICK, clicked); //*****====================================================***** // BUTTON OVER FUNCTION function over(event:MouseEvent){//MAIN BUTTONS var over:TimelineMax = new TimelineMax(); over.append(TweenMax.to(event.currentTarget.btn_txt, .5, {tint:0xffff00})); //over.append(TweenMax.to(event.currentTarget.btn_txt, 1, {dropShadowFilter:{color:0xffffff, alpha:1, blurX:5, blurY:5, distance:2.5}})); } //------------------------------------------------ //BUTTON OUT FUNCTION function out(event:MouseEvent){//MAIN BUTTONS var out:TimelineMax = new TimelineMax(); out.append(TweenMax.to(event.currentTarget.btn_txt, .5, {removeTint:true})); } //*****====================================================***** var request:URLRequest = new URLRequest("homePage.swf");//HOMEPAGE var request1:URLRequest = new URLRequest("commercial.swf");//COMMERCIAL RELOCATION var request2:URLRequest = new URLRequest("residential.swf");//RESIDENTIAL RELOCATION var request3:URLRequest = new URLRequest("buyFurniture.swf");//BUY FURNITURE var request4:URLRequest = new URLRequest("sellFurniture.swf");//SELL FURNITURE var request5:URLRequest = new URLRequest("fileMoving.swf");//FILE MOVING var request6:URLRequest = new URLRequest("shredding.swf");//DOCUMENT SHREDDING var request7:URLRequest = new URLRequest("storage.swf");//STORAGE FACILITIES var request8:URLRequest = new URLRequest("cubicle.swf");//CUBICLE INSTALLATION var request9:URLRequest = new URLRequest("about.swf");//ABOUT US var request10:URLRequest = new URLRequest("faq.swf");//FREQUENTLY ASKED QUESTIONS var request11:URLRequest = new URLRequest("movePlanning.swf");//MOVE PLANNING var request12:URLRequest = new URLRequest("moveInstructions.swf");//MOVE INSTRUCTIONS var request13:URLRequest = new URLRequest("contact.swf");//CONTACT US //*****====================================================***** var contentLoader:Loader = new Loader(); var destX:Number = 0; var destY:Number = 325; //*****====================================================***** function scene(){ contentLoader.load(request) addChild(contentLoader); var fadeIn:TimelineMax = new TimelineMax(); fadeIn.append(TweenMax.to(contentLoader, .1, {alpha:0})); fadeIn.append(TweenMax.to(contentLoader,.25, {x:destX,y:destY})); fadeIn.append(TweenMax.to(contentLoader, 1, {alpha:1})); } scene(); //*****====================================================***** function clicked(event:MouseEvent):void{ switch(event.currentTarget.name){ case"commercial": TweenMax.to(contentLoader, 1, {alpha:0, onComplete:onFinish}); function onFinish():void { contentLoader.load(request1) addChild(contentLoader); trace(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY,alpha:1}); tracker.trackPageview("commercial"); } break; //------------------------------------------ case"residential": TweenMax.to(contentLoader,1, {alpha:0, onComplete:onFinish2}); function onFinish2():void{ contentLoader.load(request2) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("residential"); } break; //------------------------------------------ case"buyFurniture": contentLoader.load(request3) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("buyFurniture"); break; //------------------------------------------ case"sellFurniture": contentLoader.load(request4) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("sellFurniture"); break; //------------------------------------------ case"fileMoving": contentLoader.load(request5) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("fileMoving"); break; //------------------------------------------ case"shredding": contentLoader.load(request6) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("shredding"); break; //------------------------------------------ case"storage": contentLoader.load(request7) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("storage"); break; //------------------------------------------ case"cubicle": contentLoader.load(request8) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("cubicle"); break; //------------------------------------------ case"about": contentLoader.load(request9) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("menu.about"); break; //------------------------------------------ case"faq": contentLoader.load(request10) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("menu.faq"); break; //------------------------------------------ case"movePlanning": contentLoader.load(request11) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("menu.movePlanning"); break; //------------------------------------------ case"moveInstructions": contentLoader.load(request12) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("menu.moveInstructions"); break; //------------------------------------------ case"contact": contentLoader.load(request13) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:destX, y:destY, alpha:1}); tracker.trackPageview("menu.contact"); break; } } //*****====================================================*****
  10. ok i got old content to fade out but the new content does not alpha in //*****====================================================***** var request:URLRequest = new URLRequest("homePage.swf");//HOMEPAGE var request1:URLRequest = new URLRequest("commercial.swf");//COMMERCIAL RELOCATION //*****====================================================***** var contentLoader:Loader = new Loader(); //*****====================================================***** function scene(){ contentLoader.load(request) addChild(contentLoader); var fadeIn:TimelineMax = new TimelineMax(); fadeIn.append(TweenMax.to(contentLoader, .1, {alpha:0})); fadeIn.append(TweenMax.to(contentLoader,.25, {x:0,y:325})); fadeIn.append(TweenMax.to(contentLoader, 5, {alpha:1})); } scene(); //*****====================================================***** function clicked(event:MouseEvent):void{ switch(event.currentTarget.name){ case"commercial": TweenMax.to(contentLoader,1,{alpha:0, onComplete:onFinish}); function onFinish():void { contentLoader.load(request1) addChild(contentLoader); TweenMax.to(contentLoader,1, {x:0, y:325,alpha:1}); //tracker.trackPageview("commercial"); } break;
  11. I am trying to tween an external swf and for some reason i keep getting this error TypeError: Error #1009: Cannot access a property or method of a null object reference. at thebarnettecompanies_fla::MainTimeline/scene() at thebarnettecompanies_fla::MainTimeline/frame1() Here is the code i have..everything looks fine to me..anyone have some suggestions of how to fix this.. //*****====================================================***** var request:URLRequest = new URLRequest("homePage.swf");//COMMERICAL RELOCATION var request1:URLRequest = new URLRequest("commercial.swf");//HOME PAGE //*****====================================================***** var contentLoader:Loader = new Loader(); //*****====================================================***** function scene(){ contentLoader.load(request) addChild(contentLoader); TweenMax.to(contentLoader,1,{x:33, y:85, alpha:1}); } scene(); //*****====================================================***** function clicked(event:MouseEvent):void{ switch(event.currentTarget.name){ case"commerical": TweenMax.to(contentLoader,1,{alpha:0, onComplete:onFinish}); function onFinish():void { contentLoader.load(request1) addChild(contentLoader); TweenMax.to(contentLoader,1, {alpha:1}); tracker.trackPageview("commercial"); } break; } }
  12. can you change the color of the circle. I must missing where the color is in the code.
  13. i got it to work a bit better. I am having issue with the insert with the last two tweens. It needs to happen the same time the rotation to "0" how do i delay three different tweens at the same time. btn1.tractor.alpha = 0; btn1.tractor.rotationY = 180; btn1.tuttle.alpha = 0; btn1.tuttle.rotationY = 180; var guestFlip:TimelineMax = new TimelineMax({repeat:5, yoyo:true, repeatDelay:3}); guestFlip.append(TweenMax.to(btn1, 1, {rotationY:180})); guestFlip.insert(TweenMax.to(btn1.woods, 1, {alpha:0})); guestFlip.insert(TweenMax.to(btn1.tractor, 1, {alpha:1})); guestFlip.append(TweenMax.to(btn1, 1, {rotationY:0, delay:3})); guestFlip.append(TweenMax.to(btn1.tractor, 1, {alpha:0})); guestFlip.append(TweenMax.to(btn1.tuttle, 1, {alpha:1}));
  14. with doing that is seems to just skip right over that second rotation btn1.tractor.alpha = 0; btn1.tractor.rotationY = 180; btn1.tuttle.alpha = 0; btn1.tuttle.rotationY = 180; var guestFlip:TimelineMax = new TimelineMax({repeat:5, yoyo:true, repeatDelay:3}); guestFlip.append(TweenMax.to(btn1, 1, {rotationY:180})); guestFlip.append(TweenMax.to(btn1.woods, 1, {alpha:0})); guestFlip.append(TweenMax.to(btn1.tractor, 1, {alpha:1})); guestFlip.append(TweenMax.to(btn1, 1, {rotationY:180})); guestFlip.append(TweenMax.to(btn1.tractor, 1, {alpha:0})); guestFlip.append(TweenMax.to(btn1.tuttle, 1, {alpha:1}));
  15. could you give me a example of what you mean. sequence of tweens. Do you mean make seperate functions and then onComplete it goes to the next function and so on then just loops back to the original.
  16. i have another issue..got the yoyo thing to work but for some reason i cannot get the short rotation to go another 180..any thoughts.. btn1.tractor.alpha = 0; btn1.tractor.rotationY = 180; btn1.tuttle.alpha = 0; btn1.tuttle.rotationY = 180; var guestFlip:TimelineMax = new TimelineMax({repeat:5, yoyo:true, repeatDelay:1}); guestFlip.append(TweenMax.to(btn1, 1, {shortRotation:{rotationY:"180"}})); guestFlip.insert(TweenMax.to(btn1.woods, 1, {alpha:0})); guestFlip.insert(TweenMax.to(btn1.tractor, 1, {alpha:1})); guestFlip.append(TweenMax.to(btn1, 1, {shortRotation:{rotationY:"180"}})); guestFlip.insert(TweenMax.to(btn1.tractor, 1, {alpha:0})); guestFlip.insert(TweenMax.to(btn1.tuttle, 1, {alpha:1}));
  17. yoyo Ma...thanks Jack...again the simple things seem to be the hardest sometimes
  18. Thanks, after I posted I came up with this. and it works but after it reverses and goes to the beginning and then stops. How do i just get it to loop back and forth. btn1.tractor.alpha = 0; btn1.tractor.rotationY = 180; var guestFlip:TimelineMax = new TimelineMax({repeat:1, repeatDelay:5}); guestFlip.append(TweenMax.to(btn1, 3, {shortRotation:{rotationY:180}})); guestFlip.insert(TweenMax.to(btn1.woods, 1, {alpha:0})); guestFlip.insert(TweenMax.to(btn1.tractor, 1, {alpha:1,onComplete:reverse}),guestFlip.duration - 0.5); function reverse(){ guestFlip.reversed = true; }
  19. I am having some issue getting my tween to reverse. any suggestions would be great. its just stays stationary and does not tween at all.. btn1.tractor.alpha = 0; btn1.tractor.rotationY = 180; var guestFlip:TimelineMax = new TimelineMax({reverse:true, repeatDelay:5}); guestFlip.append(TweenMax.to(btn1, 3, {shortRotation:{rotationY:180}})); guestFlip.insert(TweenMax.to(btn1.woods, 1, {alpha:0})); guestFlip.insert(TweenMax.to(btn1.tractor, 1, {alpha:1, delay:1})); guestFlip.reversed = true;
  20. I am having some issue getting the getting this to work. I have attached some of the code...any ideas //URL REQUEST //----------------------HOME PAGE var request1:URLRequest = new URLRequest("homePage.swf"); //----------------------PHOTO GALLERY var request2:URLRequest = new URLRequest("photo_gallery.swf"); //CONTENT LOADER var lastContent:MovieClip; // save the last content loaded var newContent:MovieClip; var contentLoader:Loader = new Loader(); contentLoader.addEventListener(Event.COMPLETE, onCompleteLoadMyExternalSWF); function onCompleteLoadMyExternalSWF(e:Event):void { var fadeOut:TimelineMax = new TimelineMax(); fadeOut.append(TweenMax.to(lastContent, 1, {onComplete:onCompeleteFadeOutLastContent})); fadeOut.append(TweenMax.to(lastContent, 1, {blurFilter:{blurX:0}})); fadeOut.append(TweenMax.to(lastContent, 1, {transformAroundCenter:{scaleX:0, scaleY:0}, ease:Sine.easeOut})); fadeOut.append(TweenMax.to(lastContent, 1, {alpha:0, ease:Expo.easeOut})); } function onCompeleteFadeOutLastContent():void { removeChild(lastContent); lastContent = newContent ; addChild(lastContent); var fadeIn:TimelineMax = new TimelineMax(); fadeIn.append(TweenMax.to(lastContent, 1, {x:1000, y:90, alpha:1, ease:Expo.easeOut})); fadeIn.append(TweenMax.to(lastContent, 1, {blurFilter:{blurX:0}})); } //----------------------------------------------- function clicked(event:MouseEvent):void{ switch(event.currentTarget.name){ case"btn_Home": contentLoader.load(request1) addChild(contentLoader); break; //------------------ case"btn_Photos"://PHOTO GALLERY contentLoader.load(request2) addChild(contentLoader); break; }}
  21. is there a way to change the 3D perspective within a tween. I have a flag that is in one perspective but i want to be able to change that perspective as it gets carried away...
  22. i am not familiar with the onStart. do you have a link i could read about or an example?
  23. is there a way within a tween to bring the mc to the front. like setChildIndex. i have two movie clips that are on the stage and both of those movie clips have animation in them as well as a button. but when the one is playing i need it to be on top so that the button cans be accessible.
×
×
  • Create New...