Jump to content
Search Community

chefkeifer

Members
  • Posts

    129
  • Joined

  • Last visited

Everything posted by chefkeifer

  1. i guess i do have a question. with to fromTo method. doesnt each image fade in and then fade out through the loop. for some reason it just shows shows image5 which is the last one in the xml file. how do you just get it image1 to fade in and then fade out and then image2 fade in and then fade out and so on. i do not want any buttons to control this just a continous loop of images... thanks
  2. nevermind. this is what happens when you make your actions panel too small..i didnt see where i copied and pasted at the top duplicates...sorry..and thanks for all your help
  3. Hey jack, i keep getting an error...i cant see where i may be duplicating the loader... Symbol 'adSlideshow', Layer 'actions', Frame 1, Line 15 Warning: 3596: Duplicate variable definition. Symbol 'adSlideshow', Layer 'actions', Frame 1, Line 15 1151: A conflict exists with definition loader in namespace internal. import com.greensock.loading.*; import com.greensock.events.*; import com.greensock.*; LoaderMax.activate([imageLoader]); var loader:XMLLoader = new XMLLoader("xml/adSlideshow.xml", {onComplete:completeHandler, estimatedBytes:50000}); loader.load(); import com.greensock.loading.*; import com.greensock.events.*; import com.greensock.*; LoaderMax.activate([imageLoader]); var loader:XMLLoader = new XMLLoader("xml/adSlideshow.xml", {onComplete:completeHandler, estimatedBytes:50000}); loader.load(); function completeHandler(event:LoaderEvent):void { var xmlQueue:LoaderMax = LoaderMax.getLoader("xmlQueue"); var images:Array = xmlQueue.content; for (var i:int = 0; i < images.length; i++) { addChild(images[i]); TweenMax.fromTo(images[i], 1, {alpha:0}, {alpha:1}); } }
  4. I am currently trying to set up a news section using the DataLoader...i just learned the basics of the imageLoader the other day but need to get this one under my belt as well. just to give you an idea how i have it setup and need it set up. i have news article in a xml file and in flash i want to import those xml articles in succession down the page. i have made for loop to make that happen but i am confused on how to setup my xml file and the LoaderMax. i have a code snippet that i saw on a previous post and tried to use that but the way that one is set up it refers to a xml file with and url to a text file. I want to eliminate that txt file and have all my data in the xml file. does that make sense. xml code now <?xml version="1.0" encoding="iso-8859-1"?> here is my AS import com.greensock.events.*; import com.greensock.loading.*; import com.greensock.*; import flash.display.Sprite; import flash.display.MovieClip; LoaderMax.activate([DataLoader]); //*****====================================================*****\\ var loader:XMLLoader = new XMLLoader("../xml/pitboard.xml", {name:"pitboards", onComplete:completeHandler}); //*****====================================================*****\\ function completeHandler(event:LoaderEvent):void { //trace("load complete. XML content: " + LoaderMax.getContent("pitboards")); var myText:String = LoaderMax.getContent("headline"); trace("Is this working: " + myText); } //*****====================================================*****\\ loader.load(); //*****====================================================*****\\ var newsContainer:Sprite = new Sprite; newsContainer.x = 20; newsContainer.y = 20; addChild(newsContainer); //*****====================================================*****\\ var newsArray:Array = new Array(); //*****====================================================*****\\ for(var k:Number=0;k<5;k++){ var newsItem:NewsItem = new NewsItem; if(k>0){ newsItem.y = k*(newsArray[k-1].height+10); } newsArray.push(newsItem); newsContainer.addChild(newsItem); } //*****====================================================*****\\
  5. i get this error ypeError: Error #1034: Type Coercion failed: cannot convert com.greensock.loading::ImageLoader@25b3a061 to flash.display.DisplayObject. with this code. import com.greensock.events.*; import com.greensock.loading.*; import com.greensock.*; LoaderMax.activate([imageLoader]); //only necessary once - allows XMLLoader to recognize ImageLoader nodes inside the XML var loader:XMLLoader = new XMLLoader("data.xml", {onComplete:completeHandler, estimatedBytes:50000}); loader.load(); function completeHandler(event:LoaderEvent):void { var image1:Bitmap = LoaderMax.getLoader("image1").rawContent; var image2:Bitmap = LoaderMax.getLoader("image2").rawContent; var loaders:Array = loader.getChildren(); for (var i:int = 0; i < loaders.length; i++) { addChild(loaders); TweenMax.fromTo(loaders, 1, {alpha:0}, {alpha:1}); } }
  6. duh...how stupid am I. So basically if there are 15 images in the que i have addChild 15 times or is there a way to put them in an array and create a tween to fade in and fade out?
  7. I am trying my first slideshow and taking baby steps to figure out how to use loaderMax. here is my code. no errors but nothing shows on the screen. import com.greensock.loading.*; import com.greensock.events.*; LoaderMax.activate([imageLoader]); //only necessary once - allows XMLLoader to recognize ImageLoader nodes inside the XML var loader:XMLLoader = new XMLLoader("data.xml", {onComplete:completeHandler, estimatedBytes:50000}); loader.load(); function completeHandler(event:LoaderEvent):void { var image1:Bitmap = LoaderMax.getLoader("image1").rawContent; var image2:Bitmap = LoaderMax.getLoader("image2").rawContent; } what am i missing to get the images to show
  8. thanks Jack, i will play with this for a bit and try to get things working...i feel sure i will have more questions... thanksagain
  9. once again its something so simple that i was overlooking... just for future reference...what exaclty does null mean? and if i get that error again on my other projects what is the best way to find where that error is coming from? thanks again for you help...i will have to apply this to my other pages so that the buttons work within the child swf's...i am sure its that darn google analytics...
  10. ok...i have finally pretty much started over as far as getting things to work properly. I have attached a working fla with all the swf that apply to it. I am still getting that one error. i have eliminated all that google stuff...i have the buttons working properly as far as getting the proper swf to come to the stage. the default page in the completeHandler function does not come up to be the actual first page to come to the stage. i know your time is limited and i do appreciate it.
  11. here is my fla. if that helps. I went from everyting working fine to nothing working at all when i moved to LoaderMax. I want to learn this becuase it has so many benifits with images and video which this site is becoming to have a lot of.
  12. Hey Jack, I fixed the url issue, still not sure why the google crap keeps showing up. I will get to that later.. but here is the output i am receiving and i also noticed when clicking the buttons the correct swf is not coming to the stage. is there a specific order that i need to have each of the arrays in or should it matter what the instance name of the button. Not sure i said that right. Should in the clickHandler be what is clicked the event.currentTarget or something that sorts. TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.greensock::TweenLite/init() at com.greensock::TweenLite/renderTime() at com.greensock.core::SimpleTimeline/renderTime() at com.greensock::TweenLite$/updateAll() and that error repeats itself about 20 times. also in the default swf does not show up at the beginning..the one in the completeHandler. I can hear the video that is playing but you cant see anything that is on that swf
  13. good eye..i forgot to take those two out of there...that will be another thread since they are outside URL's....anyway i took them away and all worked just fine but and the buttons navigated between swf but only once..meaning i was able to click on the button go to another button but if i went back to that button the swf would not come back up... these are the errrors i am getting..i am assuming the google analytics errors are on the child swf since i tried removing all google stuff and still go the error.. progress: 0.40741776857705914 progress: 0.8148355371541183 progress: 0.860752096582679 progress: 0.7109514134060105 progress: 0.9278920716130359 TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.google.analytics.core::IdleTimer() at com.google.analytics::GATracker/_trackerFactory() at com.google.analytics::GATracker/_factory() at com.google.analytics::GATracker() at btn2_fla::MainTimeline/frame1() TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.google.analytics.core::IdleTimer() at com.google.analytics::GATracker/_trackerFactory() at com.google.analytics::GATracker/_factory() at com.google.analytics::GATracker() at btn1_fla::MainTimeline/frame1() progress: 0.932391411175509 progress: 0.9372671478508771 progress: 0.6330214283280907 progress: 0.7570566614808675 progress: 0.8810918946336441 progress: 0.9669831139778108 progress: 0.7833733089629212 progress: 0.8724331229233623 progress: 0.9614929368838034 progress: 0.9775094616539719 TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.google.analytics.core::IdleTimer() at com.google.analytics::GATracker/_trackerFactory() at com.google.analytics::GATracker/_factory() at com.google.analytics::GATracker() at btn4_fla::MainTimeline/frame1() TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.google.analytics.core::IdleTimer() at com.google.analytics::GATracker/_trackerFactory() at com.google.analytics::GATracker/_factory() at com.google.analytics::GATracker() at btn3_fla::MainTimeline/frame1() progress: 0.9803700407004002 progress: 0.9836926610179856 progress: 0.9878030510113966 progress: 0.8903181875132783 progress: 0.9617194437029815 progress: 0.9914136764521629 TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.google.analytics.core::IdleTimer() at com.google.analytics::GATracker/_trackerFactory() at com.google.analytics::GATracker/_factory() at com.google.analytics::GATracker() at btn6_fla::MainTimeline/frame1() progress: 0.9931568711833568 progress: 0.9934630197580228 progress: 0.9967207918194687 Loading error on SWFLoader 'loader6' (fr_palmetto): Error #2035: URL Not Found. URL: file:///C|/Users/keith/Documents/Websites/ATV%20Redneck%20Nationals/fr_palmetto error occured with SWFLoader 'loader6' (fr_palmetto): SWFLoader 'loader6' (fr_palmetto) > Error #2035: URL Not Found. URL: file:///C|/Users/keith/Documents/Websites/ATV%20Redneck%20Nationals/fr_palmetto progress: 1 LoaderMax 'mainQueue' is complete! Loading error on SWFLoader 'loader7' (fr_busco): Error #2035: URL Not Found. URL: file:///C|/Users/keith/Documents/Websites/ATV%20Redneck%20Nationals/fr_busco error occured with SWFLoader 'loader7' (fr_busco): SWFLoader 'loader7' (fr_busco) > Error #2035: URL Not Found. URL: file:///C|/Users/keith/Documents/Websites/ATV%20Redneck%20Nationals/fr_busco
  14. thanks for working with me on this..you have always been there for me...I have tried to incorporate you code into what i have and see to be headed in the right direction but i am getting this error TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.greensock.loading.core::LoaderItem/_setRequestURL() at com.greensock.loading.core::LoaderItem() at com.greensock.loading.core::DisplayObjectLoader() at com.greensock.loading::SWFLoader() at main_test_fla::MainTimeline/frame1() and this is my code.. import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; import com.google.analytics.AnalyticsTracker; import com.google.analytics.GATracker; //*****====================================================*****\\ var tracker:AnalyticsTracker = new GATracker( this, "UA-17893711-1", "AS3", false ); tracker.trackPageview("btn1"); tracker.trackPageview("btn2"); tracker.trackPageview("btn3"); tracker.trackPageview("btn4"); tracker.trackPageview("btn5"); tracker.trackPageview("btn6"); tracker.trackPageview("fr_palmetto"); tracker.trackPageview("fr_busco"); tracker.trackPageview("fr_broad"); //*****====================================================*****\\ var btns:Array = [btn1,btn2,btn4,btn5,btn6,fr_palmetto,fr_busco,fr_broad,facebook,gear,evtSchedule]; var swfs:Array = ["btn1.swf", "btn2.swf","btn3.swf","btn4.swf","btn5.swf","btn6.swf","fr_palmetto", "fr_busco", "fr_broad"]; //*****====================================================*****\\ fr_palmetto.btn_txt.text = "Home" btn2.btn_txt.text = "Registration" btn1.btn_txt.text = "Series Schedule" btn4.btn_txt.text = "Parks" btn5.btn_txt.text = "CMT Redneck Wedding" btn6.btn_txt.text = "Contact" fr_busco.btn_txt.text = "Busco Beach Highlights" fr_broad.btn_txt.text = "Broad River Highlights" //*****====================================================*****\\ var activeTween:TimelineLite; var curLoader:SWFLoader; var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); LoaderMax.prioritize("fr_palmetto"); activeTween = null; //*****==========================*****\\ for (var j:int = 0; j < btns.length; j++) { btns[j].buttonMode = true; btns[j].addEventListener(MouseEvent.ROLL_OVER, over); btns[j].addEventListener(MouseEvent.ROLL_OUT, out); btns[j].addEventListener(MouseEvent.CLICK, clickHandler); activeTween = new TimelineLite({paused:true}); activeTween.insert(TweenMax.to(btns[j], .5, {glowFilter:{color:0xffffff, alpha:1, blurX:15, blurY:15, inner:true}})); activeTween.insert(TweenMax.to(btns[j], .5, {dropShadowFilter:{color:0x000000, alpha:1, blurX:5, blurY:5, distance:5}})); btns[j].tween = activeTween; btns[j].loader = new SWFLoader(swfs[j], {estimatedBytes:3000, container:this,x:0,y:315,alpha:0, autoPlay:false}); queue.append( btns[j].loader ); } //*****====================================================*****\\ queue.load(); //*****====================================================******// function over(event:MouseEvent):void { activeTween = event.currentTarget.tween; activeTween.play(); } //*****=====================*****\\ function out(event:MouseEvent):void { activeTween.reverse(); } //*****====================================================*****\\ function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); } //*****====================================================******// function completeHandler(event:LoaderEvent):void { var image:ContentDisplay = LoaderMax.getContent("fr_palmetto"); TweenLite.to(image, 1, {alpha:1}); trace(event.target + " is complete!"); } //*****====================================================******// function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } //*****====================================================******// function clickHandler(event:MouseEvent):void { if (curLoader != null) { TweenMax.to(curLoader.content, 0.5, {autoAlpha:0}); } curLoader = event.currentTarget.loader; addChild(curLoader.content); TweenMax.to(curLoader.content, 0.5, {autoAlpha:1}); }
  15. my buttons are done this way. var activeTween:TimelineLite; activeTween = null; //*****==========================*****\\ for (var j:int = 0; j < btns.length; j++) { btns[j].buttonMode = true; btns[j].addEventListener(MouseEvent.ROLL_OVER, over); btns[j].addEventListener(MouseEvent.ROLL_OUT, out); btns[j].addEventListener(MouseEvent.CLICK, clickHandler); activeTween = new TimelineLite({paused:true}); activeTween.insert(TweenMax.to(btns[j], .5, {glowFilter:{color:0xffffff, alpha:1, blurX:15, blurY:15, inner:true}})); activeTween.insert(TweenMax.to(btns[j], .5, {dropShadowFilter:{color:0x000000, alpha:1, blurX:5, blurY:5, distance:5}})); btns[j].tween = activeTween; } so i guess i get confused with the multiple buttons..that would be a lot of if statements with six or eight buttons in the clickHandler function...
  16. Ok i finally dived into the LoaderMax per you question to me in the Tweening forum. The reason I have not gotten into it is that i do not fully understand it yet. Working on. I will say after doing some reading i was able to get something to work on the first try. That never happens for me. anyway my question is how do i incorporate buttons and for jsut a simple fade in and out of external swf's. I have six buttons that i have in an array that i tween for the over and out states but for the click function is where i am clueless. I just want to be able to click on that button and that specific swf will come to the stage and the one that is already on the stage will just tween out. make sense... here is the code to get the default(home page) external swf to appear whne first coming to the site var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); queue.append( new SWFLoader("fr_palmetto.swf", {name:"fr_palmetto", estimatedBytes:3000, container:this,x:0,y:315,alpha:0, autoPlay:false}) ); LoaderMax.prioritize("btn1"); queue.load(); //*****====================================================******// function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); loadMC.scaleX = event.target.progress; } //*****====================================================******// function completeHandler(event:LoaderEvent):void { var image:ContentDisplay = LoaderMax.getContent("fr_palmetto"); TweenLite.to(image, 1, {alpha:1}); trace(event.target + " is complete!"); loadMC.visible = false; } //*****====================================================******// function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); }
  17. I am having an issue trying to get video that is playing from an external swf to stop when you go to another page. i have read and read and looked and looked for tutorials and nothing seems to be what i am looking for. isnt somewhere i can add the removeChild(contentLoader) within my tweenmax varaible to make this video quit playing here is my code var contentLoader:Loader = new Loader(); contentLoader.contentLoaderInfo.addEventListener("progress", looping); contentLoader.contentLoaderInfo.addEventListener("complete", fadeIn); //*****====================================================***** var swf:MovieClip; var destX:Number = 0; var destY:Number = 300; loadMC.visible = false; //*****====================================================***** var defaultSWF:URLRequest = new URLRequest("fr_palmetto.swf"); //*****====================================================***** contentLoader.load(defaultSWF); addChild(contentLoader); var contentIn:TimelineMax = new TimelineMax(); contentIn.append(TweenMax.to(contentLoader, 1, {x:destX, y:destY, alpha:1})); //*****====================================================***** function looping(e:ProgressEvent):void { loadMC.visible = true; var perc:Number = Math.round((e.bytesLoaded / e.bytesTotal) * 100); loadMC.txtPercent.text = perc + "%"; } function clicked(event:MouseEvent):void{ transLoad(event.target.name + ".swf"); } function transLoad(url:String):void{ if(contentLoader.content){ var out:TimelineMax = new TimelineMax(); out.insert(TweenMax.to(contentLoader, .75, {alpha:0, onComplete:transIn, onCompleteParams: [url])})); } else { transIn(url); } } function transIn(url:String):void{ addChild(contentLoader); contentLoader.load(new URLRequest(url)); } function fadeIn(event:Event):void{ loadMC.visible = false; var fader:TimelineMax = new TimelineMax(); fader.append(TweenMax.to(contentLoader, 0, {alpha:0})); fader.append(TweenMax.to(contentLoader, 0, {x:0, y:300})); fader.insert(TweenMax.to(contentLoader, 2, {alpha:1})); fader.insert(TweenMax.to(contentLoader,.75, {x:destX, y:destY})); } //*****====================================================*****
  18. I have an array of buttons that when i roll over i want and animation to that button to happen (which works) but also have another movie clip (the content) to autoAlpha:1..the movie clip (the content) is already on the stage and autoAlpha= 0; and when you roll out i want the movieClip (the content) to autoAlpha= 0. i have this code so far but it is not working for me. i think i am missing something here.. import com.greensock.*; import com.greensock.plugins.*; import com.greensock.easing.*; //*****====================================================*****\\ //*****====================================================*****\\ import flash.events.MouseEvent; var btns:Array = [monday, tuesday, weds, thursday, friday, sunday]; //THESE ARE MOVIE CLIPS ON THE STAGE var spec:Array = [monday_lg, tuesday_lg, weds_lg, thursday_lg, friday_lg, sunday_lg]; //*****====================================================*****\\ var activeTween:TimelineLite; for (var i:int = 0; i < btns.length; i++) { btns[i].buttonMode = true; btns[i].addEventListener(MouseEvent.ROLL_OVER, over); btns[i].addEventListener(MouseEvent.ROLL_OUT, out); //btns[i].addEventListener(MouseEvent.CLICK, clicked); activeTween = new TimelineLite({paused:true}); activeTween.append(TweenMax.to(btns[i], .5, {glowFilter:{color:0xFF8000, alpha:1, blurX:15, blurY:15, inner:true}})); btns[i].tween = activeTween; } //*****====================================================*****\\ activeTween = null; //*****====================================================*****\\ function over(event:MouseEvent):void { activeTween = event.currentTarget.tween; TweenMax.to(event.target.name + "_lg", .5, {alpha:1}); activeTween.play(); } function out(event:MouseEvent):void { activeTween.reverse(); }
  19. I understand teh timelineMax part.. i was just copying and pasting and was going to clean that part of the code up later..but i am not understanding how to remove the child with a tween. essentially i just want to be able to click the button and the movieclip appears on the stage and then when they click the "x" button..ie "clsBtn" the movieclip will exit the stage with a tween...
  20. why can't i get this to work. am i missing something here clsBtn.alpha = 0; clsBtn.buttonMode = true; clsBtn.addEventListener(MouseEvent.CLICK, exitSurvey) surveyBtn.buttonMode = true; surveyBtn.addEventListener(MouseEvent.CLICK, enterSurvey); function enterSurvey (e:MouseEvent):void { var newSurvey:survey = new survey(); this.addChild(newSurvey); var enterSur:TimelineMax = new TimelineMax(); enterSur.insert(TweenMax.to(newSurvey, 0, {alpha:0, x:450, y:375})); enterSur.appendMultiple(TweenMax.allTo([newSurvey, clsBtn], 1, {alpha:1})); } function exitSurvey (e:MouseEvent):void { var exitSur:TimelineMax = new TimelineMax(); exitSur.appendMultiple(TweenMax.allTo([newSurvey, clsBtn], 1, {alpha:0, onComplete:this.removeChild, onCompleteParams:[newSurvey]})); }
  21. sorry..apparently I have asked this question before..I found the answer
  22. how do you change the color to the dot? I am trying to acheive a look of smoke and it doesnt really like smoke when its green:)
  23. perfect thank you very much
  24. i have a list of ingredients that are doing into a bowl one after another and i tried to simplify the code..and cannot get it to work.. old code var intro:TimelineMax = new TimelineMax({repeat:-1}); intro.insert(TweenMax.to(pepper1, 1, {bezier:[{x:293, y:134}, {x:235, y:345}], scaleX:.25, scaleY:.25})); intro.insert(TweenMax.to(pepper2, 1, {bezier:[{x:293, y:134}, {x:235, y:345}], scaleX:.25, scaleY:.25}), .25); intro.insert(TweenMax.to(pepper3, 1, {bezier:[{x:293, y:134}, {x:235, y:345}], scaleX:.25, scaleY:.25}), .50); intro.insert(TweenMax.to(pepper4, 1, {bezier:[{x:293, y:134}, {x:235, y:345}], scaleX:.25, scaleY:.25}), .75); intro.insert(TweenMax.to(tom1, 1, {bezier:[{x:293, y:134}, {x:235, y:345}], scaleX:.25, scaleY:.25}), 1); intro.insert(TweenMax.to(tom2, 1, {bezier:[{x:293, y:134}, {x:235, y:345}], scaleX:.25, scaleY:.25}), 1.25); intro.insert(TweenMax.to(tom3, 1, {bezier:[{x:293, y:134}, {x:235, y:345}], scaleX:.25, scaleY:.25}), 1.50); simplified code that does not work...only one ingrdient come out and tweens var ingrd:Array = [ing1, ing2, ing3, ing4, ing5, ing6, ing7]; //*****====================================================*****\\ var activeTween:TimelineLite; for (var i:int = 0; i < ingrd.length; i++) { activeTween = new TimelineLite({paused:true}); activeTween.append(TweenMax.to(ingrd[i], 1, {bezier:[{x:293, y:134}, {x:235, y:345}], scaleX:.25, scaleY:.25}), .25); } function init():void { activeTween.play(); } init(); what am i doing wrong. i want one ingredient to follow the same path but tween every .25 seconds after the other...does that make sense
  25. actually I figured it out. I went searching the forums...and found what I was looking for. I suggest that all should do that before posting. It can help a lot.
×
×
  • Create New...