Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by chefkeifer

  1. I have been following Zync's tutorial and have done everything he has done. As far as i know. I keep getting this error. TypeError: Error #1010: A term is undefined and has no properties. at main/xmlLoaded() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.greensock.loading.core::LoaderCore/_completeHandler() at com.greensock.loading::XMLLoader/_completeHandler() at com.greensock.loading::XMLLoader/_receiveDataHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() here is my code. package { import com.greensock.events.*; import com.greensock.loading.*; import com.greensock.*; import flash.display.Sprite; import flash.display.MovieClip; import com.greensock.loading.XMLLoader; import com.greensock.events.LoaderEvent; import com.greensock.loading.LoaderMax; import com.greensock.loading.ImageLoader; import com.greensock.loading.data.ImageLoaderVars; import flash.display.MovieClip; import flash.text.TextField; import flash.events.MouseEvent; import com.greensock.loading.display.ContentDisplay; public class main extends Sprite { public var thumbHolder:MovieClip; public var mainHolder:MovieClip; public var titleTxt:TextField; public var descTxt:TextField; private var xImgList:XMLList; public function main() { //load in our xml var xPhotography:XMLLoader = new XMLLoader("xml/buggies.xml"); xPhotography.addEventListener(LoaderEvent.COMPLETE, xmlLoaded); xPhotography.load(); } private function xmlLoaded(e:LoaderEvent):void { var xData:XML = e.target.content; xImgList = new XMLList(xData.img); //Setup a loadermax object var thumbLoader:LoaderMax = new LoaderMax({name:"thumbLoader"}); thumbLoader.addEventListener(LoaderEvent.COMPLETE, thumbsLoaded); //setup variables for our imageLoader Vars var nImgWidth:Number = 150; var nImgHeight:Number = 100; var nMaxCols:Number = 2; for (var i:int = 0; 1 < xImgList.length(); i++) { var iLoad:ImageLoader = new ImageLoader("images/buggies/" + xImgList[i].@url, new ImageLoaderVars() .name(xImgList[i].@name) .width(nImgWidth) .height(nImgHeight) .smoothing(true) .container(thumbHolder) .x((i % nMaxCols) * nImgWidth) .y(int(i / nMaxCols) * nImgHeight) .scaleMode("proportionalOutside") .crop(true) .prop("index", i) .prop("url", xImgList[i].@url) .prop("title", xImgList[i].@title) .prop("desc", xImgList[i].@desc) .alpha(0) ) thumbLoader.append(iLoad); } thumbLoader.load(); } private function thumbsLoaded(e:LoaderEvent):void { //setup click events for our thumbnails for (var i:int = 0; 1 < xImgList.length(); i++) { var cdImg:ContentDisplay = LoaderMax.getContent("p" + (i+1)); cdImg.buttonMode = true; cdImg.addEventListener(MouseEvent.CLICK, thumbClick); TweenMax.to(cdImg, 1, {autoAlpha:1, delay:(i*0.2)} ); } } private function thumbClick(e:MouseEvent):void { var vars:Object = ImageLoader(e.currentTarget.loader).vars; trace(vars.title); checkOldImage(vars.index) } private function checkOldImage(index:Number):void { //check if theres alreayd an image loaded if(mainHolder.numChildren > 0) { var oldClip:Sprite = Sprite(mainHolder.getChildAt(0)); TweenMax.to(oldClip, 0.5, {autoAlpha:0, onComplete:function(){ mainHolder.removeChildAt(0); loadImage(index) } }); }else { loadImage(index); } } private function loadImage(index:Number):void { //Get filename var file:String = xImgList[index].@url; //change text display titleTxt.text = "Title:" + xImgList[index].@title; descTxt.text = "Description:" + xImgList[index].@desc; //setup our main image loader var mainLoad:ImageLoader = new ImageLoader("images/buggies/" + file, new ImageLoaderVars() .width(500) .height(500) .scaleMode("proportionalInside") .container(mainHolder) .smoothing(true) ) //setup event listeners mainLoad.addEventListener(LoaderEvent.COMPLETE, imageLoaded); mainLoad.load(); } private function imageLoaded(e:LoaderEvent):void { var imgClip:ContentDisplay = LoaderMax.getContent(e.currentTarget.name); TweenMax.to(imgClip, 0, {colorTransform: {exposure:2}} ); TweenMax.to(imgClip, 1.5, {colorTransform: {exposure:1}, autoAlpha:1} ); } } }
  2. thanks carl, that was a big help and stupid oversight on my part. As always it the little things that stump yor the longest time. I also figured out the columns with the following code just for future reference import com.greensock.events.*; import com.greensock.loading.*; import com.greensock.*; import flash.display.Sprite; import flash.display.MovieClip; var loader:XMLLoader = new XMLLoader("../xml/buggies.xml", {name:"buggies", onComplete:completeHandler}); loader.load(); function completeHandler(event:LoaderEvent):void { var xml:XML = event.target.content; var xmlItems:XMLList = xml.buggies; var columns:int = 2; var xPos:int = 0; var yPos:int = 0; var counter:int = 0; var item:buggieItem; for each(var xmlItem:XML in xmlItems) { item = new buggieItem(); addChild(item); item.title.text = xmlItem.title[0].text(); item.condition.text = xmlItem.condition[0].text(); item.model.text = xmlItem.model[0].text(); item.features.text = xmlItem.features[0].text(); item.salePrice.text = "$" + xmlItem.salePrice[0].text(); item.image.text = xmlItem.image[0].text(); item.x = xPos; item.y = yPos; counter++; if ( counter > ( columns - 1 ) ) { counter = 0; xPos = 0; yPos += 210;//item.height; } else { xPos += 545;//item.width; } } i am still need of some help if you dont mind. I need to know how to get the image to show up in each of them as well... i understand the xml part but i am not sure how to get that info from xml with just the dataLoader..do i need to do another imageLoader to get that to happen?
  3. I am wondering why when the first node which is this item.title.text = xmlItem.title[0].text(); is in there causes an error and they overlap as well...not sure how to word that.. but when i comment that out all works just fine..the movieclip loops and with all the data from the xml work just. i have attached a working fla file i am also trying to figure it out how to get these to show up in two columns and not one continueous column thanks for your help http:// http://www.nicholsbuggies.com/greensock ... uggies.zip
  4. Hey Jack, thanks for all you help in the past. but of course I still have issues. I am trying to bring in a swf from another folder that contains the SlideshowExample you create (its tweaked to fit my needs). All works seperatly, meaning when i test the seminole_photos1.fla it works just fine. When i test the fr_seminole.fla it works fine except when i click on the first photo icon to pull in that seminole_photos1.swf into fr_seminole.swf. I hope that makes sense. I am wondering if the folder structure is all out of wack. Not sure why the pictures one show up. this is the error i get when clicking on that first photo icon Loading error on XMLLoader 'loader0' (assets/data.xml): Error #2032: Stream Error. URL: file:///C|/Users/keith/Documents/Websites/atvRedneckNationals/flash/test/photos/assets/data.xml i have tried every folder structure i can think and it still cant get any images to show here is a link to a scaled down fla folder package... http:// http://www.keifersdesign.com/greensock/test.zip
  5. Is there a way to zoom upon the users mouseclick on the stage. for instance if the user click on certain part of the page it will then zoom from that point. Is transformAroundCenter the way to go about this?
  6. sorry Jack. i was unsure if you could or would download from my server... here is the zipped file with the html, css, flash, and the huge swf file thanks again for hanging with me. http:// http://www.keifersdesign.com/greensock/test.zip
  7. the reason i didnt upload the subloading file is because its 20megs...but i changed the file location to point to the url. here is my html. pretty plain and simple thanks for you help.
  8. i guess the reason you didnt see anything is that your probably using mozilla. for some reason that is the only browser nothing shows up in. Not sure why. anyway here is my fla.
  9. thanks again for you help and i have done my research and have come up with another issue...or course...thats me..ask my wife..just kidding...all works just fine except for when you the user goes to the page initianally...it acts a bit wierd...it uploads very huge...here is the link to see what i am talking about.. http:// http://www.worldkarting.com/online.maga ... .scene.php but if you minimize it all works just fine...as well when yo maximize again..it works just fine...its just when you first go to the site...not sure what the issue could be...i thought you could still have some insight...this is the code i have been using and learning from import com.greensock.layout.*; import flash.display.StageAlign; import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; this.stage.align = StageAlign.TOP_LEFT; var ls:LiquidStage = new LiquidStage(this.stage, 1024, 853, 100, 100); var topArea:LiquidArea = LiquidArea.createAround(topBar_mc, {scaleMode:ScaleMode.WIDTH_ONLY}); topArea.pinCorners(ls.TOP_LEFT, ls.TOP_RIGHT); ls.attach(logo, ls.BOTTOM_RIGHT); ls.attach(archives, ls.TOP_LEFT); var magArea:LiquidArea = new LiquidArea(this, 150, 60, 1024, 700); var magLoader:SWFLoader = new SWFLoader("01.2011.karting.scene.swf", {name:"kartingScene", container:this, alpha:0, onProgress:progressHandler, onError:errorHandler, onComplete:completeHandler, onInit:onMagLoaded}); magLoader.load(); function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); } function completeHandler(event:LoaderEvent):void { trace(event.target + " is complete!"); } function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } function onMagLoaded(event:LoaderEvent):void { magArea.attach(magLoader.content, {scaleMode:ScaleMode.PROPORTIONAL_INSIDE}); TweenLite.to(magLoader.content, 1, {alpha:1}); TweenMax.to(magLoader.content, 1, {dropShadowFilter:{color:0x000000, alpha:1, blurX:12, blurY:12}}); }
  10. thanks again Jack...i kept pulling from the wrong com folder...I will get this... one last question ...in this code what does the 400,400 refer too i know that the 800,800 is the width and height of my stage but not sure what the other is refering too var ls:LiquidStage = new LiquidStage(this.stage, 800, 800, 400, 400); also in this code i know that the 0,60 is the x and y coordinates for the magLoader but not sure what the 800,700 is refering too var magArea:LiquidArea = new LiquidArea(this, 0, 60, 800, 700); thanks again
  11. i tested the file you sent and i still get that coercion error Scene 1, Layer 'Layer 1', Frame 1, Line 14 1118: Implicit coercion of a value with static type Object to a possibly unrelated type String. Scene 1, Layer 'Layer 1', Frame 1, Line 35 1118: Implicit coercion of a value with static type Object to a possibly unrelated type String. i know i have the latest version because i just renewed jsut the other day. What could be the issue?
  12. I am Shockingly Green. i renewed the other day. I appreciate your help...
  13. not that new to AS but still learning. i am very new to the liquid stage part. i am using your loadSWF to load the swf which is in side of a movie clip. i have actaully started over since i posted this. and yes that code was copied and pasted. i use the example and was going to learn from it and tweak it. here is what i came up with when i started over. i still get that coersion error i have attached a fla
  14. also, is it better to make my whole project small with higher quality images and when it expands doesnt lose quality. or do i make it big and then have it scale down. I am at a loss fo where to start, even though i am almost done...lol
  15. I am trying to do an online magazine. i made my layout in inDesign CS5 and exported it out to a swf. I have some code that imports the swf into my flash file. The problem i am having is that its too big for most browsers. right now i have my flash file setup as 1525x850 to fit the exported (inDesign) swf. I want to be able to scale if someones monitors size or browser size it smaller. How do i go about this ? i am using this code and i keep getting a coercion error import com.greensock.layout.*; //create a LiquidStage instance for the current stage which was built at an original size of 550x400 //don't allow the stage to collapse smaller than 550x400 either. var ls:LiquidStage = new LiquidStage(this.stage, 625, 400, 625, 400); //attach a "logo" Sprite to the BOTTOM_RIGHT PinPoint ls.attach(logo, ls.BOTTOM_RIGHT); //create a 300x100 rectangular area at x:50, y:70 that stretches when the stage resizes (as though its top left and bottom right corners are pinned to their corresponding PinPoints on the stage) var area:LiquidArea = new LiquidArea(this, 50, 70, 300, 100); //attach a "myImage" Sprite to the area and set its ScaleMode to PROPORTIONAL_OUTSIDE and crop the overspill area.attach(myImage, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE, crop:true}); //if you'd like to preview the area visually (by default previewColor is red), set preview to true area.preview = true; //attach a RESIZE event listener to the LiquidStage instance (you could do this with the LiquidArea as well) ls.addEventListener(Event.RESIZE, onLiquidStageUpdate); function onLiquidStageUpdate(event:Event):void { trace("updated LiquidStage"); }
  16. Thanks Jack, my next task will be to add a preloader. I feel sure you will hear from me again. Thanks again for all your help over the past couple of years.
  17. It was more for the liquid stage. my client has a lot of members, as does most of the world, with different screen resolutions. I want them to be able to see the whole magazine will fit not matter what they have, up to a certain point of course... if this is the right application i will get to working on my learning. This part of flash is new to me. and still not 100% certain on how to make the above happen...
  18. Is this application something that would benifit when making online digital magazines. Will this help with the site fitting the page no what size browser the user has? Am i getting that right. I have to make an online digital magazine and will be doing it inDesign and then moving it over to flash. I have often wondered how those other mags out there keep the resolution and fit no matter the browser size. here is an example of what iam going to be creating. http://walsworthdigipub.com/primos/productcatalog.html
  19. I am wondering if the first image is not showing until all the images are loaded. It really takes a long time for you to see the first image. There are 19 images in the xml file and i want that first image to show while the rest are loading. How do i achieve this. http:// www.atvrednecknationals.com is the site and you will see in the top a blank white screen and then after about 20 seconds the slideshow starts with the first image. here is the code import com.greensock.loading.*; import com.greensock.events.*; import com.greensock.*; import flash.display.Sprite; LoaderMax.activate([imageLoader]); var loader:XMLLoader = new XMLLoader("../xml/headerPics.xml", {onComplete:completeHandler, estimatedBytes:50000}); loader.load(); function completeHandler(event:LoaderEvent):void { var imageSeconds:Number = 2; var transitionSeconds:Number = 1; var xmlQueues:LoaderMax = LoaderMax.getLoader("xmlQueues"); var images:Array = xmlQueues.content; TweenMax.allTo(images, 0, {autoAlpha:0, x:-450}); addChild(images[0]); TweenMax.to(images[0], transitionSeconds, {autoAlpha:1}); var sequence:TimelineMax = new TimelineMax({delay:transitionSeconds, repeat:-1}); for (var i:int = 1; i < images.length; i++) { addChild(images[i]); sequence.append( new TweenMax(images[i], transitionSeconds, {autoAlpha:1}), imageSeconds); sequence.append( new TweenMax(images[i - 1], 0.01, {autoAlpha:0}) ); } sequence.append( new TweenMax(images[0], 0.01, {autoAlpha:1}), imageSeconds); sequence.append( new TweenMax(images[images.length - 1], transitionSeconds, {autoAlpha:0}) ); }
  20. I guess i am not sure how to do that. do i need to something like this. function completeHandler(event:LoaderEvent):void { var image:ContentDisplay = LoaderMax.getContent("home.swf"); TweenLite.to(image, 1, {alpha:1}); trace(event.target + " is complete!"); curLoader == null; } becuase that didnt do anything.
  21. I have this code and i am trying to make when i click to make the default home.swf alpha 0. all functionality works just fine but when i click on my navigation buttons the default home.swf does not go away how do i fix this. 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 = [home, schedule, parks, contact]; var swfs:Array = ["home.swf","schedule.swf","parks.swf","contact.swf"]; //*****====================================================*****\\ home.btn_txt.text = "HOME" schedule.btn_txt.text = "SCHEDULE" parks.btn_txt.text = "PARKS" contact.btn_txt.text = "CONTACT" //*****====================================================*****\\ var activeTween:TimelineLite; var curLoader:SWFLoader; var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); LoaderMax.prioritize("home"); activeTween = null; //*****==========================*****\\ for (var j:int = 0; j < btns.length; j++) { btns[j].buttonMode = true; btns[j].mouseChildren = false; 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("home.swf"); 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}); }
  22. jack, thank you once again. Happy Holidays to you and yours...
  23. I have done the follwing and i cant seem to get it to work. once again i just cant get my head around it. it seems so easy sometimes but then i just cant see the big picture.. i am just trying to pull data from an xml file and have it loop within a movieclip and dynamic text boxes...hell, i dont know if i am even explaining myself the right way...thanks for all your help i have attached an fla file...
  24. Jack you are awesome..like you have done for me for the past couple of years... you have helped me through some difficult times. I am one of those that if i see a working example i can figure things out. I am not the best coder and i know that some out there its a first language. me, its greek and i am learning..so seeing it first hand and making it work for me is a great help in my learning process..once again thanks for sticking with me....happy holidays...
  25. Jack for some reason i just cant get any of this to work. i have tried all your examples and i know i am missing something. i have attached a test fla file so you can see that image5 shows up right away and it never changes.