Jump to content
Search Community

carlosfandang

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by carlosfandang

  1. Hi, I think I've basically go to grips with loadermax, but wonder if you could give me an idea ond a silly problem that I'll try and explain but is still related to the 3rd party dispatchevent!! Basically, I animate my main site at load (I keep the load small initially for many reasons, including stuttering from 3rd party apps loading during animation). Then I load swfs when I need them (i.e the .load() event only occurs when a menu button is clicked). However, it seems crazy not to actually have some of these sub swf's loading in the background, BUT I have a newbie problem concerning "if" a sub swf is loaded or "else" (but not relating to your loadermax oncomplete). My main issue is that most of my sub swf's are built through third party apps, they are quite large galleries and therefore I would like to load them once and then just play with visibility, etc. Makes sense - I load a sub swf, a "loading" icon is displayed until the third party app dispatches it's own complete event at the end of a load (as this post originally dealt with). That's cool - show icon, then hide it on 3rd party dispatchevent. Then I hide the window when other menus are clicked. My problem is that if I then click on that menu again (say to toggle the visibility of the app) - then the "loading" icon is displayed again, but as the 3rd party app is already loaded it will not disappear as there is no dispatchevent again from the 3rd party app. Whilst, I've done a "hoaky" fix (replace the original menu button on first click with another that doesn't launch the "loading" code) - is there a way to code some script to say if "3rd party dispatchevent has already happened "don't show loading layer again". This also affects why I am not loading it in the background - if a user clicks the menu and it hasn't finished loading, then that's fine, but if it has finished then the "loading" icon is shown and won't disappear - again I could do a "hoaky fix" but surely there is a simpler way!! Sorry for longwinded explanation, but hope that makes sense. Thanks in advance.
  2. Thanks for the quick reply, as always I appreciate your kidn help. I started looking into all your suggestions and then suddenly had a "newbie" brainwave (stroke/ wonder if!), I tried it and it works!! Bascially, I imported the swf into the library and went into the movieclip and just added 2 more frames for each keyframe. So, whilst probably not the done thing, it's slowed everything down by 2/3rd's - result. Of course it's easier on a small web banner, but will look into your suggestions for content that is more complex. Thanks again, you the man. Fandang
  3. Hi, I am running my main site at 30fps and most of my loaded swfs are at the same fps. However, I have a number of flash banners I have made in the past that I want to display using Loadermax. These banners run at between 12-15fps (I no long have the fla's just the swf's, so can't change them) - when loaded they run at 30fps as per the main site. I don't suppose there is a way of running them at their own fps?? Cheers Fandang
  4. Mmmm - well you've got me there I'm afraid. The photo galleries are all standalone SlideShowPro components - which are pre-coded and there doesn't seem to be much ability to mess around with it. The answer is yes, I didn't know about LoaderMax before I used these, but also don't have much chance of correcting it. The only thing I can find from their forum re:QueueLoader errors is to disable Content Caching. Might try that, but it does work for the average user!!
  5. Well, seem to have been at this since forever - but many thanks to Greensock and all the help on the forum - my first fully Flash website is now completed (for the time being!). See what you think: www.fandang.com Cheers Fandang
  6. Genius - thank you so much for your continued help. That did the trick beautifully and I think it's all slowly sinking in!!
  7. Hi, I'm getting stuck with something which I'm sure is dead simple - event listening and dispatch. Find it hard anyway, let alone through using it in LoaderMax. Basically, I'm using LoaderMax to load separate SWF's ("EventsAlbum", etc) into a parent SWF ("Gallery Holder"). That's cool, got that and very happy there. But my problem is that the child swf's are SlideShowPro galleries which have a delay in starting up in their AS3 component (so you get a blank screen for a while - it's a recognised problem with their component!!). So I thought, I could get the parent to listen for the "onAlbumStart" event that you can script in the child (i.e when the gallery has completed its load) and then run a TweenMax. BUT I'm just not understanding the event bubbling process at all !! So I have a LoaderMax set up and then a btn function load it: var queue1:LoaderMax=new LoaderMax({name:"photoQueue1"}); queue1.append( new SWFLoader("photos/events.swf", {name:"EventsAlbum", estimatedBytes:96000, visible:false, container:this, x:44, y:47}) ); queue1.load(); var contentevents:ContentDisplay = LoaderMax.getContent("EventsAlbum"); function eventslaunch(event:MouseEvent):void { // set loader content and visibility LoaderMax.getContent("EventsAlbum").visible = true; The child script is below - this says when the Album has loaded and started: eventsgallery.addEventListener(SSPAlbumEvent.ALBUM_START, onAlbumStart); // Preloading is done, what to do now? function onAlbumStart(eventObject):void { trace("GALLERY LOADED"); }; In the parent, I simply want to know when "onAlbumStart" has happened and then run a simple Tween. Can anybody help a dumbass with the script to dispatch event in the child and then listen through a LoaderMax in the parent? Sorry, I'm always the stupid one, but I'm learning!!
  8. Thanks for the quick response, I agree I am probably doing it wastefully - and through lack of expertise!! I think I need to re-think the loading process. Currently, the external swf's only start loading on a menu click. I think therefore, I should have everything loading at the beginning, and have a look at prioritising. Thanks, I'll have to try and get to grips with the queue mechanism.
  9. Hi, just discovered Loadermax - very nice thank you. I have a snag I can't seem to get around (mainly because my knowledge is still limited). The scenario is this: 1) I have a number of timeline animations for each menu button - each has an onComplete event to load an external swf - "addChild(Loader.content);" 2) I am using the onComplete in my animation timeline because the animation needs to finish first, then load the swf (interim solution). 3) The external swf's (e.g "First.swf") run their own animations BEFORE they then load another swf into themselves ("external subwindow") - these are 3rd party swf's including highslide photo gallery and coverflow gallery. I accept it's clunky, but I was trying to minimise initial preload and lack of skill!! Right that aside, all that's important is that "First.swf" preloads (3rd party apps take care of their own loading). 4) Thus, I have 2 oncomplete events that I need to synchronise. How do I ensure that "timeline1" ONLY runs addChild IF "FirstLoader" has actually completed its loading of "First.swf". So in very basic terms and stripped down, my code is: var timeline1:TimelineMax = new TimelineMax({onReverseComplete:triggerQueue, paused:true}) timeline1.insertMultiple([ new TweenMax(whatever}}), new TweenMax(whatever, 2, {blurFilter:{blurX:3, blurY:3, quality:2}, onComplete:finish}), ], 0); // function finish(){ FirstLoader.load(true); addChild(FirstLoader.content); } My Loadermax is set up as this: FirstLoader = new SWFLoader("First.swf", {name:"First", x:0, y:0, estimatedBytes:920000, onComplete:FirstcompleteHandler}); } function FirstcompleteHandler(event:LoaderEvent):void { Object(FirstLoader.rawContent).Firststart(); //that gets my external timeline running in First.swf } function FirstClick(MouseEvent:Event):void { RunTimelineAnimation(); //runs timeline1 } Any help much appreciated, I'm not very good with IF statements and listeners!! Thanks so much in advance
  10. Hi, Forgive my stupidity, but I'm having problems with running my tweens in frame 2 after a preload. I'm using AS3 so PreloadAssetManager is not really for me. I have a number of fairly complex tweens running in separate swf's that I want to load into a parent swf. I want to make sure they have completed loading before the animation starts (which is instant) and therefore, wanted to do a preload inside the external swf's in frame1 and then goto frame2 and start the animations. Frame1 action script in each file would be: stop(); //Listener addEventListener(Event.ENTER_FRAME,loading) ; Mouse.hide(); // Mouse Hide preloading.startDrag(true); //Drag Start function loading(e:Event){ var loaded = Math.round(stage.loaderInfo.bytesLoaded); //Download File Size var total = Math.round(stage.loaderInfo.bytesTotal); //Total File Size var getPercent = loaded/total; preloading.txt.text = Math.round(getPercent*100); if (loaded == total) { //File Download Finished Site or Project Open 2. frame removeEventListener(Event.ENTER_FRAME,loading); preloading.stopDrag(); Mouse.show(); gotoAndPlay(2); } } I have the import greensock classes and all the assets on frame2, and it just won't work. I'm new at this, so just not been able to work it out, get an error #1009. Am I putting the import classes and assets in the wrong place? Thanks for any help.
  11. Genius, thank you so much. I'm really having to study this hard to get to grips with it, but thank you again. Just to share with other users on the forum looking for similar functionality, the final solution is provided below - and to be honest "Greensock" pretty much did it all. Basically, it provides the following: 1) Each menu button has its own animation - plays at normal speed. 2) Each animation will run, after a reverse (reverse plays at twice speed) of the other animations and a delay between them. 3) The "reset" function also has an oncomplete (this is separate - I use it because it affects other animation unrelated to the menu animations). The menu functionality: var activeTimeline:TimelineMax; var queuedTimeline:TimelineMax; function activateTimeline(tl:TimelineMax):void { if (activeTimeline != tl && activeTimeline != null && activeTimeline.currentTime != 0) { queuedTimeline = tl; activeTimeline.reverse(); activeTimeline.timeScale = 2; } else { queuedTimeline = null; activeTimeline = tl; activeTimeline.play(); activeTimeline.timeScale = 1; } } function triggerQueue():void { activeTimeline = queuedTimeline; if (activeTimeline != null) { activeTimeline.delay = 0.75; activeTimeline.timeScale = 1; activeTimeline.restart(true); queuedTimeline = null; } } function resetclick(event:MouseEvent):void { if (activeTimeline != null) { var t:TimelineLite = new TimelineLite({timeScale:2}); t.append( activeTimeline.tweenTo(0, {onComplete: myfunction}) ); } } The code at the beginning of each separate menu animation: var yourtimeline:TimelineMax = new TimelineMax({onReverseComplete:triggerQueue, paused:true}) The code in the menu button listener: function menuclick(event:MouseEvent):void { activateTimeline(yourtimeline); Brilliant, thank you for all the help and hopefully this may prove useful to those looking to run animations from menu clicks with a sort of oncomplete function. Fla enclosed. Cheers Fandang
  12. Well, I decided to take the easy route based on what knowledge I have. I simply created a blank timeline (i.e no animation) to replace the reset click. Now the "home reset" works at double speed on the reverse and fades in the assets animation for the homepage - not good coding I suppose, but works fine. Of course I had to reduce the delay between animations, as that takes me back to my original problem of not having a delay from when you're technically on the homepage! Thanks for the continued help.
  13. Thanks for the response again, unfortunately I'm so fresh with scripting I haven't worked out how to just set a boolean variable for the reset function only in triggerQueue (I'll keep looking at it, but as I said, it's all trial and error with me!). So I successfully implemented the tweenTo oncomplete function which achieved what I wanted apart from the timescale. I see you covered this topic with user gerrydesign. All my reverse animations run at timescale = 2, whilst play runs at timescale = 1. So sadly, the reset tweenTo reverse is great apart from it runs at the timelines original speed. Thanks anyway, will have to keep trying to work things out. Cheers
  14. Thanks for the response, just back from a trip and I will have a look into your suggestions. I got the timescale reverse (speed) sorted by trial and error, so I'm learning all the time. Thanks
  15. Hello Mr Greensock, I've been playing around with all of this and I'm learning fast, but as usual I have a question. I have enclosed an updated file so you can see what I'm trying to do (albeit a much simpler version of my animations). So I'm using the triggerQueue() as you kindly pointed out. In the enclosed example, the menus move the relevant square with a "1" delay on the reversecomplete as your code answered my last question (thanks). I have some animation that runs all the time (i.e the 3 balls in the example - when ball1 anim. completes it restarts all ball timelines again). So far so good. What I want to do, is when a menu button is clicked, the balls fade (turn alpha to zero), note ... the animation still continues that's fine. That was straightforward putting the function call inside "function activateTimeline(tl:TimelineMax)". So, whenever a menu bttn is clicked the ball animation is "alpha'd out". This is what I'm stuck on - when the "reset bttn" is clicked, I want to have the balls appear again (alpha:1) WHEN the open timeline.reverse completes. Whilst I can easily put the function "ballsappear()" inside the reset function and use a timeline delay (see commented out code at bottom of actionscript in file), it's not quite there. You see in the file that one animation is longer than the others, so the delay works great for some but appears to soon for others. I also wanted to have the reverse run at a faster speed than the "play". I can't work out how to run "ballsappear()" ONLY when the reset button is clicked and whatever timeline.reverse has completed. My scripting is still relatively new and I tried: function resetclick(event:MouseEvent):void { if (activeTimeline != null) { activeTimeline.reverse({onComplete: ballsappear}); } } and various different other options, but to no avail. AM I BEING REALLY STUPID HERE ??!! Many thanks for working hard to educate us numpties. Best regards Fandang menuclick.fla.zip
  16. Brilliant thanks, I will look into that. With regards to clicking things quickly, actually I already decided that because my animations are quite complex I didn't want "click happy" problems, so each menu button already disables the mouseenabled property on the buttons until the tweens have finished - clunky, but it forces people to wait for the tweens to finish (they are only a few seconds long anyway). Appreciate your continued help.
  17. If you want them to tween to -100 on the Y axis, then you have "_100" as opposed to "-100" - remove the underscore and it works fine.
  18. I was hoping I could get one more piece of advice on the code greensock posted above. When the timeline reverses and then plays a new timeline it is instantaneous. I've tried a "delayedCall" / "delay" in the triggerqueue and activetimeline functions but can't seem to get it to work. I'm trying to put a pause between the reversed timeline and the next timeline that plays. I obviously don't want to put that pause in the associated timeline itself, because I don't want the delay when a button is first clicked and isn't reversing anything else. I could create a duplicate timeline with a pause in, but it seems crazy and I suspect there is a simple way to put the pause in the function. Any help as always much appreciated.
  19. Genius, thank you so much for your trouble, much appreciated. Looking at the file, I understand the concept of what you have done, but will now dig around on here using the file as a reference so that I can learn more and thoroughly understand exactly what you have kindly posted for me. As you said, I have complex animations using all sorts of scaling, shearing, alpha, etc - so this will be invaluable and I will be happy to post it up when I'm done and show that even Noobs can persevere!! Thanks again
  20. Ok, now I'm massively confused, I clearly have not got the hang of this at all. I have attached a new file: 1) One black square - 3 timelines 2) Click each button and the black square is meant to go to the relevant coloured holder, but return to the black holder first (i.e if in the red holder and I click blue, it's meant to return to the black holder first then go to blue). I'm getting stupidly confused having tried oncompletereverse, etc - anybody fancy helping a dunce out? Thanks
  21. Thanks, I'll have a look into this when I have a moment. With regards to the pause, I did put an initial pause into the code at the beginning, but it seems that as soon as I call for the currentTime to be zero, it then starts playing even though the code is paused right from the start - don't know, presumably currenttime asks to return to zero and then says "start playing"!! Thanks and will look into the arrays.
  22. Thanks for the quick reply. I have tried your suggestions and slowly understanding how they they work. I was fine setting each of your suggestions up for 1 button to reverse and play another, but got confused trying to do it for all for buttons and associated timelines. Now I'm trying to figure out 2 things: 1) If a button is set to reverse timeline1 and then play timeline2 - how do I also get that button to reverse timeline3 and 4 aswell. I have 4 buttons which need to reverse 3 other timelines and then play it's own timeline. I tried to duplicate all the oncompletes, but it barfed. 2) So then I looked at currentTime - I duplicated the currentTime code x 3 to put timeline2/3/4 to 0 and then play timeline1 (redtimeline below). function redclick(event:MouseEvent):void { TweenMax.to(bluetimeline, bluetimeline.currentTime, {currentTime:0, ease:Linear.easeNone, onComplete:redtimeline.play}); TweenMax.to(greentimeline, greentimeline.currentTime, {currentTime:0, ease:Linear.easeNone, onComplete:redtimeline.play}); TweenMax.to(pinktimeline, pinktimeline.currentTime, {currentTime:0, ease:Linear.easeNone, onComplete:redtimeline.play}); } That worked, but I'm having trouble figuring out how to ensure the timelines pause when they are set back to currentTime: 0 - basically all the timelines then play from 0. That makes sense, but where do I put the pause function - tried it in the { }, but no joy. Sorry, I suspect it's really simple, but my learning curve is a bit jagged!! Thanks
  23. Hi, I'm a real noob, but I have successfully managed to create some quite complex animations, but I'm being really thick I'm sure, so be nice. Having read the forum i think quite thoroughly about reverse, oncomplete, etc ... I just can't work out what to do (think because I have multiple timelines to reverse and delay). Here's the problem in a nutshell: 1) I have a very complex animation with numerous assets (movieclips) that fade, scale, etc 2) I have 4 content areas - each button animates the assets (same assets) in a different way from the same start point and then loads a different external swfs 3) This is fine I can do that no problem - 4 different timelines attached to each button eventlistener and loading / unloading swf's - got that sussed. 4) But, what I'm stuck with is "reverse", then play. I can get each button to animate the assets from the same start point and even get the home button to reset to original starting point using reverse of the timelines. What I can't fathom (probably 'cos I'm stupid!) is how to get a button to reverse the other 3 buttons animations to the start point and then trigger the animation for that button (i.e a delay or oncomplete of the reverse). I have enclosed a simple example of 4 squares (schoolboy version of my real file) that animate on clicking the colour "button" and a home (reset) button that reverses all animations to start point. But now stuck - For instance, if I clicked the red button (red square enlarges) and then the blue button - how do I get the red square timeline to reverse and oncomplete, the blue timeline then plays (they are both simultaneous currently). AND the home button obviously has to reverse any timeline open at the time??? Would really appreciate a pointer - always willing to learn, just becoming hairless in the process!! Thanks import com.greensock.*; import com.greensock.plugins.*; import com.greensock.easing.*; TweenPlugin.activate([ColorTransformPlugin, FrameLabelPlugin, BezierThroughPlugin, RemoveTintPlugin, SetSizePlugin, FramePlugin, BlurFilterPlugin, TransformMatrixPlugin, GlowFilterPlugin, RoundPropsPlugin, ColorMatrixFilterPlugin, ScrollRectPlugin, EndArrayPlugin, DropShadowFilterPlugin, ShortRotationPlugin, VisiblePlugin, BevelFilterPlugin, BezierPlugin, QuaternionsPlugin, VolumePlugin, AutoAlphaPlugin, HexColorsPlugin, TintPlugin]); //event listeners for buttons reset.addEventListener(MouseEvent.CLICK, resetclick); redbtn.addEventListener(MouseEvent.CLICK, redclick); bluebtn.addEventListener(MouseEvent.CLICK, blueclick); greenbtn.addEventListener(MouseEvent.CLICK, greenclick); pinkbtn.addEventListener(MouseEvent.CLICK, pinkclick); //functions for buttons function resetclick(event:MouseEvent):void { redtimeline.reverse(); bluetimeline.reverse(); greentimeline.reverse(); pinktimeline.reverse(); } function redclick(event:MouseEvent):void { redtimeline.play(); bluetimeline.reverse(); greentimeline.reverse(); pinktimeline.reverse(); } function blueclick(event:MouseEvent):void { bluetimeline.play(); redtimeline.reverse(); greentimeline.reverse(); pinktimeline.reverse(); } function greenclick(event:MouseEvent):void { greentimeline.play(); redtimeline.reverse(); bluetimeline.reverse(); pinktimeline.reverse(); } function pinkclick(event:MouseEvent):void { pinktimeline.play(); redtimeline.reverse(); bluetimeline.reverse(); greentimeline.reverse(); } //Greensock actions on squares //red square var redtimeline:TimelineMax = new TimelineMax(); redtimeline.insertMultiple([ new TweenMax(redsq, 1, {glowFilter:{color:0xffffff, alpha:1, blurX:25, blurY:25}}), new TweenMax(redsq, 1, {scaleX:1.5, scaleY:1.5}), ], 0); redtimeline.pause(); //blue square var bluetimeline:TimelineMax = new TimelineMax(); bluetimeline.insertMultiple([ new TweenMax(bluesq, 1, {glowFilter:{color:0xffffff, alpha:1, blurX:25, blurY:25}}), new TweenMax(bluesq, 1, {scaleX:1.5, scaleY:1.5}), ], 0); bluetimeline.pause(); //green square var greentimeline:TimelineMax = new TimelineMax(); greentimeline.insertMultiple([ new TweenMax(greensq, 1, {glowFilter:{color:0xffffff, alpha:1, blurX:25, blurY:25}}), new TweenMax(greensq, 1, {scaleX:1.5, scaleY:1.5}), ], 0); greentimeline.pause(); //pink square var pinktimeline:TimelineMax = new TimelineMax(); pinktimeline.insertMultiple([ new TweenMax(pinksq, 1, {glowFilter:{color:0xffffff, alpha:1, blurX:25, blurY:25}}), new TweenMax(pinksq, 1, {scaleX:1.5, scaleY:1.5}), ], 0); pinktimeline.pause();
×
×
  • Create New...