Jump to content
Search Community

Carl last won the day on December 24 2023

Carl had the most liked content!

Carl

Moderators
  • Posts

    9,824
  • Joined

  • Last visited

  • Days Won

    546

Everything posted by Carl

  1. if the XMLLoader is loading an XML file that has 4 SWFLoaders, the XMLLoader will have 4 children put this into your XMLLoader complete handler: trace("evertything loaded"); trace("children of XMLLoader " + event.target.getChildren()); trace("number of children of XMLLoader " + event.target.getChildren().length); in the above event is the LoaderEvent that is being passed to the function as in: function queueComplete(event:LoaderEvent){} your argument name may vary without seeing more code or xml it will be very difficult offer any more assistance. perhaps you can upload your files with small images if you need more help.
  2. the big problem is that you are using an old and incomplete version of the greensock files. you have none of the LoaderMax classes. Go to http://www.greensock.com/tweenlite and download the latest version. copy the com folder to the same folder as your fla second: your addCallback function doesn't match the name of the function you want to reference you have tl.addCallback(playSound1, tl.duration); but your method is called playSound() (you are missing the 1) function playSound():void{ sound1.gotoSoundTime(0, true); } make sure those names match, use playSound1 or playSound in BOTH cases. after that I couldn't test anymore as you didn't provide the sound files. I think that will get you pretty close though.
  3. http://www.actionscript.org/forums/show ... ostcount=2 that is a handy script to get all children of any movie clip or displayObjectContainer. while that loop is running, you can push each child into an array, then use the allFrom/to on that array.
  4. I don't know what those errors are. please post the complete error. it will either tell you what line of code is the problem or what function the error is caused by. nothing jumped out after a quick glance. best bet is to zip you files and attach them.
  5. if you use TimelineMax there is a tweenTo method http://www.greensock.com/as/docs/tween/ ... l#tweenTo() its as easy as myTimeline.tweenTo("someLabel"); //or myTimline.tweenTo(3) // 3 seconds
  6. RedGiant, Thanks for taking the time to test and post your recent results. It's odd that the single-swf runs much worse, I suspect that it perhaps is filling the entire browser window and thus the re-draw regions are larger... possibly? As for why the baked vs system results are very similar (unlike my results) a guess is that your system is so powerful that whatever optimizations may be present in the baked version are negligible given all the horsepower you have to run the system player. I really have no idea. Even though your results aren't exactly what I was expecting, they do provide further evidence that BlitMask w/ bitmapMode out-performs the other options by a considerable margin.
  7. the same effect could be generated with code that looks similar to: var tl:TimelineLite= new TimelineLite(); tl.append(TweenLite.to(mc, 2, {glowFilter: {color:0xff0000, blurX:10, blurY:10, strength: 3, alpha:1}})); tl.append(TweenLite.to(mc, 2, {glowFilter: {blurX:0, blurY:0, strength: 5}})); tl.append(TweenLite.to(mc, 2, {glowFilter: {blurX:50, blurY:50, strength: 5, remove:true}})); I know you admit you were being lazy and all, we've all done it, and you just are curious of the performance issues. I'm not expert in this arena, but here's my 2 cents: Chances are you could "get away" with your method, and I don't necessarily have the knowledge to tell you EXACTLY how garbage collection would handle this or what performance hit you could take. I've been around this forum enough though to trust the experts that strongly recommend against using anonymous functions and chaining them as you have as the potential for future trouble is high. Even if it runs great for you right now, you probably don't want to build further on top of this knowing that there is such potential for things to go wrong when the proper way of doing it (see above) is much more elegant, flexible and reliable. If you can figure out how to manage those three nested onCompletes, I assure you that learning TimelineLite/Max will be a breeze and you will absolutely fall in love with it.
  8. RedGiant, Just so you know I have been seeing the same bizarre variance in the blitmask demo performance in Chrome when viewing the same swf in different places: http://greensock.com/as/swf/BlitMask_Demo.swf I get the expected results of BlitMask raging at 60fps mask and scrollRect lagging at 15fps These results are similar on the same system (iMac quad core i5) in FireFox and Safari when viewing the official blitmask page. http://www.greensock.com/blitmask/ Viewing the official blitmask page, like you, in Chrome, BlitMask soars at 60fps and scrollRect and Mask can be anywhere from 40-60. in FireFox and Safari on my iMac and a much older macbook, BlitMask runs at 60 and the others in the teens (as expected). This is the strangest Flash Player performance variance I have ever seen. I did a bunch of tests running the swf locally, changing the embed code, clearing cache and other totally fruitless experiments. My latest test offers the most conclusive evidencethat there is just simply something different about the Chrome version of Flash Player. Chrome uses its own version of Flash Player that is "baked into" the browser. Chrome keeps this version updated all the time and the user doesn't ever have to intervene. The chrome version of Flash Player has its own version number (although currently it is the same as the other os variants) Chrome does allow you to disable the integrated chrome version and use your SYSTEM version that the other browsers use. Following the instructions on this page: http://kb2.adobe.com/cps/839/cpsid_83950.html I was able to disable the integrated version and tell Chrome to use my system version of Flash Player and the demo on http://www.greensock.com/blitMask performed exactly as I have seen it in other browsers and on other machines with FP 10. The only caveat here is that my system version on my iMac is Flash Player 11 Incubator that supports the Molehill / stage3D stuff. Regardless, I'm near certain that this is the closest thing I can get to proof that the Chrome version is simply... different. Is it better optimized? don't know. Is it a glitch? don't know. If you have the time to disable your integrated player, it would be great to see if the results offer conclusive proof that the integrated plugin is the culprit in Chrome. Thanks to greensock for inspiring me to dig into more info on the Chrome version of Flash Player. -Carl
  9. try var mySwf1:SWFLoader = new SWFLoader("Clock.swf", {width:200, height:200, x:-300, y:-300, container:this, onComplete:completeHandler1}); mySwf1.load(); function completeHandler1(event:LoaderEvent):void { TweenMax.fromTo(event.target.content, 3, {x:270, y:250, scaleX:.5, scaleY:.5, alpha:0}, {x:270, y:250, scaleX:2, scaleY:2, alpha:1, delay:3}); TweenLite.delayedCall(15, mySwf1.unload) }
  10. to display a string of random numbers of a set length function randomNumber(min:Number, max:Number):Number { return Math.floor(Math.random() * (1 + max - min) + min); } trace(randomNumber(1000, 9999)); the above will give you a random 4 digit number. adjust the min/max as needed.
  11. I don't believe that is possible. If it were I'm sure there would be video players / components with that functionality. if you were to use a blitting technique where you captured each frame to a bitmap then you could control the rate at which those bitmaps were displayed, but that would be fairly advanced and quite possibly very memory intensive.
  12. something like this should work fine: var sound:MP3Loader = new MP3Loader("sound.mp3", {onComplete:init, autoPlay:false}); sound.load(); //set up the timelinemax var tl:TimelineMax = new TimelineMax({paused:true}) tl.append(TweenLite.to(mc, 2, {x:589})); tl.addCallback(playSound, tl.duration); //wait for the sound to load function init(e:LoaderEvent):void { tl.play(); } function playSound():void{ sound.gotoSoundTime(0, true); } you could also use playSound as an onComplete in a tween like you had, but make sure the callback function is not expecting a LoaderEvent.
  13. you can record the initial y values of your letters when the file first loads. when you build your ROLL_OUT event handler function it will basically say "tween the movie clip that just fired a ROLL_OUT back to it's initial position you can paste this code into the file you provided: import com.greensock.*; import com.greensock.easing.*; import flash.display.MovieClip; //record the y values of all the letters d_mc.initY = d_mc.y; e_mc.initY = e_mc.y; s_mc.initY = s_mc.y; i_mc.initY = i_mc.y; g_mc.initY = g_mc.y; n_mc.initY = n_mc.y; //---DESIGN drops in and bounces---\\ TweenMax.from(d_mc, 2, {y:-200, ease:Bounce.easeOut}); TweenMax.from(e_mc, 2, {y:-200, ease:Bounce.easeOut, delay:.5}); TweenMax.from(s_mc, 2, {y:-200, ease:Bounce.easeOut, delay:1}); TweenMax.from(i_mc, 2, {y:-200, ease:Bounce.easeOut, delay:1.5}); TweenMax.from(g_mc, 2, {y:-200, ease:Bounce.easeOut, delay:2}); TweenMax.from(n_mc, 2, {y:-200, ease:Bounce.easeOut, delay:2.5}); //---DESIGN Mouse RollOvers---\\ d_mc.addEventListener(MouseEvent.ROLL_OVER, bob); e_mc.addEventListener(MouseEvent.ROLL_OVER, bob); s_mc.addEventListener(MouseEvent.ROLL_OVER, bob); i_mc.addEventListener(MouseEvent.ROLL_OVER, bob); g_mc.addEventListener(MouseEvent.ROLL_OVER, bob); n_mc.addEventListener(MouseEvent.ROLL_OVER, bob); function bob(e:MouseEvent){ var mc:MovieClip = e.target as MovieClip; trace(mc.name); TweenMax.to(mc, .5, { y:"30", repeat:-1, yoyo:true}); } //---DESIGN Mouse RollOuts---\\ // each button can use the same eventListener as they all use the same tween style d_mc.addEventListener(MouseEvent.ROLL_OUT, goBack); e_mc.addEventListener(MouseEvent.ROLL_OUT, goBack) s_mc.addEventListener(MouseEvent.ROLL_OUT, goBack) i_mc.addEventListener(MouseEvent.ROLL_OUT, goBack) g_mc.addEventListener(MouseEvent.ROLL_OUT, goBack) n_mc.addEventListener(MouseEvent.ROLL_OUT, goBack) function goBack(e:MouseEvent){ var mc:MovieClip = e.target as MovieClip; trace(mc.name); TweenMax.to(mc, .5, { y:mc.initY}); } the font I use for AS is Monaco. although not exactly what is being used here, you may find this tutorial helpful in the future: http://www.snorkl.tv/2010/08/assign-eve ... enttarget/
  14. we are all safe after the hurricane. Thanks! the reason your values are conflicting is because your stage is set up to measured in centimeters and not pixels. click off stage, go to properties panel, click on "EDIT" button next to the stage size. set "ruler units" to pixels. in order to avoid the over/out glitchiness you can put invisible movieclips on top of your letters that respond to mouse events and don't move. when you roll over the the "invisible hit area" clip you tell the proper letter to tween away.
  15. Great, Ben. Glad to hear it worked and you liked the tutorial!
  16. It is a bit difficult to understand exactly what you want to do. I'm guessing English isn't your first language and that's ok. When seeking help it is best to provide the least amount of code possible to get to a solution. Right now the loading of 2 xml files and preloading images seems to clutter the issue of parsing attributes in the xml. I've made an example of how to parse one of the xml files and access the various attributes: xmlContent.xml AS3 parsing code import com.greensock.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.XMLLoader; var myXML:XMLLoader = new XMLLoader("xmlContent.xml", {onComplete:getXML}); myXML.load(); function getXML(e:LoaderEvent):void{ var loadedXML:XML = myXML.content as XML; trace("this is all the xml"); trace(loadedXML); //create an XMLList of just the content nodes var contentXML:XMLList = loadedXML..content; trace("\n\ncontent XMLList"); trace(contentXML); trace("\n\nthe id of the first content") trace(contentXML[0].@id); trace("\n\nloop through the id and discription of all content") for(var i:uint = 0; i trace(contentXML[i].@id + " : " + contentXML[i].@discription); } } there is an fla and sample xml attached. When you test the swf you will see many descriptive traces If you truly do intend to load an XML file and have all the images preload it would be much easier to do something like this: http://www.snorkl.tv/2011/08/loading-im ... xmlloader/ also the XMLLoader documentation has sample code of loading multiple assets from xml and adding description attributes. http://www.greensock.com/as/docs/tween/ ... oader.html by using the rawXML (as mentioned in the link above) you can attach any amount of formatted data to your loaders
  17. it appears your fla is CS5.5 and I only have CS5. please upload again as a CS5 or less. thanks
  18. When you use ThrowPropsPlugin.to(dial, {throwProps:{rotation:{velocity:rVelocity, min:landingValue, max:landingValue}, resistance:resistance}, ease:Strong.easeOut, onComplete:startAgain}, 10, 0.25, 2); to trigger the onComplete, an Event object is not passed to the callback function. so change startAgain to: function startAgain():void { dial.addEventListener(Event.ENTER_FRAME, noMouseDownHandler); } now startAgain() is expecting 0 arguments and the error should go away
  19. hello illegalbrain, i got hit by hurricane irene. haven't had internet access since sunday am. just checking in on things from a relative's house on my laptop. i tried looking at your file but I couldn't open it with CS4. My ability to help you is going to be EXTREMELY limited until I get internet access back at home. to check the x/y values of your object after a tween completes add an onComplete callback: TweenMax.to(d_mc, .5 {x:2.1351, y:8.6333, onComplete:test}); function test(){ trace("x: " + d_mc.x); trace("y: " + d_mc.y); } or you could just have a button that you click that does the same trace for you. also in most cases it is best to tween to have your assets in flash set on whole pixel values so that they display accurately. when you place items on half-pixels images and text will blur. I will help you more when things are back to normal. right now there are tons of fallen trees that have messed things up for miles. ps. to upload files to the forum, just make sure you zip them first (i know that isn't totally clear when trying to upload). Best, Carl
  20. no problem. it's rare that I'm able to trouble shoot these screwball issues, I'm very glad it worked. Flash has a way of teaching you many lessons like these by making your life miserable for a few hours /days. The good news is you probably won't have this problem again:)
  21. x of 2 and y of 8 would most definitely be in the upper left hand corner. if you want to post an fla I'll take a look at it. c
  22. it really depends on the situation, but avoid situation #2. If coding on the timeline you want as much code and as many assets as possible on Frame 1. if code controls a movie clip it must be on the same frame as the movie clip. setting visible to false on assets that aren't needed right away is probably what I do most. I will also put groups of assets into container movie clips so that I can just tell one movie clip to have visible false. if you want to be really efficient with breaking your visual assets and tweening code up into sections check out how the GreenSock homepage animation was made: http://www.snorkl.tv/2011/05/real-world ... ase-study/ If you are just starting out just focus on getting a few TweenLite/Max basics under your belt http://www.greensock.com/get-started-tweening/ and then get into TimelineLite/Max http://www.greensock.com/timelinemax
  23. i don't think this is related to your issue as your swf does load, but to save you any nightmares in the future, its a good idea to not have spaces in the file names of assets that are involved in any sort of browser experience. var loader:SWFLoader = new SWFLoader("http://www.oliart.co.uk/schooloffish/school of fish.swf -------- it very well could be a cross domain issue. I noticed that the link you provided is: http://oliart.co.uk and the subloaded swf is at http://www.oliart.co.uk having www in the subloaded swf and not in the container url may make flash think the subloaded swf is loading from a different domain, in which case it may prevent communication between the 2. read this: http://kb2.adobe.com/cps/142/tn_14213.h ... Comparison especially the part about "incompatible domains in flash player 7+" does it work better if you visit this link? http://www.oliart.co.uk/schooloffish/
  24. I would call it a Dynamic Animation Explorer or Builder.
  25. It seems you are well on your way to getting some good findings on your own. I've heard from quite a few sources that Fireworks does a much better job at compressing than Photoshop so you can start with a higher quality image at lower size: http://webdesignerwall.com/general/fire ... ompression so if you bring in a well-compressed jpg to flash you can choose "use imported jpg data" and be done with it. Or you can try to skim a few more kb off by letting Flash re-compress it. --------- for transparent images, you can bring in transparent png and then use Flash's jpg compression on the way out and you can make it smaller and still preserve the transparency. if you have the time to manually mask your images, that will probably give you a better file size savings -------- I haven't had to really crunch a banner in awhile so I'm a little rusty on all the tricks. I think you will get more thorough responses if you posted in http://forums.adobe.com/community/flash ... ns&start=0
×
×
  • Create New...