Jump to content


  • Posts

  • Joined

  • Last visited

JFP's Achievements


Newbie (1/14)



  1. It did, I think. I just called super.dispose(); before the loader.dispose(true); Seems like you disarmed the timebomb, thanks
  2. Hi there, there's a weird function I don't quite understand the purpose of in a script I hired somebody to write. Im hunting for a bug that causes the application Im working on to crash sometimes. I'm wondering if it's the following: override public function dispose():void { trace("dispose" + this.name); thumbholder.removeEventListener(MouseEvent.CLICK, onThumbClick); infoWindow.closer.removeEventListener(MouseEvent.CLICK, onCloseClick); langChooser.removeEventListener(Event.CHANGE, onLangChange); } Would the script above have any influence on thie following: private function closeInfo():void { if (loader != null) { loader.dispose(true); loader = null; } TweenMax.to(infoWindow, 1, {autoAlpha:0}); infoWindow.whiteout.gotoAndStop(1); langChooser.visible = false; } Because there's also a bunch of images and mp4's that get loaded - would the overriding of the dispose function leave those videos and images in the memory, bloating it until the application crashes due to overfilling the memory? I mean do just the eventListeners get removed this way or does overriding dispose() this way still permit the command to get rid of anything else in the loader? Any help would be much appreciated. edit: Also, nothing gets traced out in the debugger so trace("dispose" + this.name); seems odd to me as well..
  3. Oh my God thanks so much for answering, I'd just updated it and thought I'd gotten it figured down to something fishy in the constructor arguments!
  4. Dear someone, Ive been trying to solve this for literally 10 hours. Ive tried having my timeline and restart method in a function and to my knowledge, exhausted all existing snippets & videos on the internet. This makes the timeline jump straight to the end in bizarre bursts, play the video, then restart for me, but when it restarts the video no longer plays.. (I did include restart instead of play because Im trying to get a timeline to loop.) Ive gotten every conceivable outcome except the one I am trying to achieve and can no longer think about the problem clearly. Any help would be wildly appreciated, here's what I've got - bear in mind this is probably jumbled gibberish by now.. this is simply the latest version of the code which Ive tried to get as close to the original but seems to be bringing me further from the goal - at this point it just sits there laughing at me Ok now Ive ctrl+z'd all the way back to when it was working more closely.. seems to do what it should... one time import com.greensock.*; import com.greensock.easing.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.VideoLoader; import com.greensock.loading.LoaderMax; TweenMax.to(img7,0,{alpha:0}); TweenMax.to(img8,0,{alpha:0}); TweenMax.to(img9,0,{alpha:0}); /* var video:VideoLoader = new VideoLoader("OneWeb1.mp4", {onComplete:electricSats, container:videoHolder, width:879, height:437, scaleMode:"stretch", crop:true, autoPlay:false}); video.addEventListener(VideoLoader.VIDEO_COMPLETE, onComplete);*/ //video.pause(); var myTimeline:TimelineMax = new TimelineMax() trace("Starting timeline"); myTimeline.to(img7, 0, {alpha:0}) //.addLabel("spinn") .to(videoHolder, 0 , {alpha:0}) .to(bubi, 0, {x:383.80}) .to(img7, 1, {alpha:1}, {onComplete:trace("img1")}) .to(img7, 1, {alpha:0, delay:0}) .to(img8, 0, {alpha:0}) .to(bubi, 0, {x:427.80}) .to(img8, 1, {alpha:1}, trace("img2")) .to(img8, 1, {alpha:0, delay:0}) .to(img9, 0, {alpha:0}) .to(bubi, 0, {x:467.80}) .to(img9, 1, {alpha:1}, trace("img3")) .to(img9, 1, {alpha:0, delay:0}) .to(bubi, 0, {x:511.80}) .to(videoHolder, 1 , {alpha:1}, trace("videoHolder alpha 1")) var video:VideoLoader = new VideoLoader("OneWeb1.mp4", {container:videoHolder, width:879, height:437, scaleMode:"stretch", crop:true, autoPlay:false}); video.addEventListener(VideoLoader.VIDEO_COMPLETE, onComplete); video.load(); myTimeline.addCallback(video.playVideo, 7); //video.gotoVideoTime(0, true); //video.gotoVideoTime(0, true, true); //addChild(VideoLoader.content); //video.gotoVideoTime(0); // myTimeline.insert(TweenMax.to(video, 0, )); //myTimeline.gotoVideoTime(0); //timeline.pause(); /* function playVideo(e:LoaderEvent):void{ VideoLoader.video.gotoVideoTime(0.1, true); } */ // function rewindAndPause(evt:Event=null):void{ trace("timeLine restart1"); video.pauseVideo(); //rewind the video so that when we fade it in again later, it's already displaying the first frame and there's no delay skipping to it. ; video.gotoVideoTime(0); TweenMax.to(videoHolder, 1, {alpha:0, onComplete:restartLine, delay:1}); }; function onComplete(e:LoaderEvent):void{ trace("video done playing"); video.removeEventListener(VideoLoader.VIDEO_COMPLETE, onComplete); trace("video done playing2"); TweenMax.to(this,0, {onComplete:rewindAndPause, delay:1}); trace("video done playing3"); }; function restartLine(evt:Event=null):void{ trace("timeLine restart2"); myTimeline.restart(); } stop(); please help! All I want is three images to fade in and out in succession, then a video to play, then repeat the timeline ad infinitum.. Im losin it here..
  5. JFP

    Blitmask blues

    Hi thanks for your reply, so it isn't possible to have an interactive, wrapping, infinitely swipeable blitmask?
  6. Hi there, I'm stumped, and it's probably because I've been up all night with this code.. After staring at it and tinkering with it, borrowiing bits from other snippets and trying various combinations for so long it all seems like an ugly, jumbled mess to me now and I can no longer tell up from down. There's no denying it anymore, I need help. There's a bug in here that I can't pin down. At first it would seem everything is normal, but then you realize there is something gravely wrong with how the overlap or the offset is being massacred on mouseDown. Or mouseMove. I've given up, any help would be really appreciated. Ive also enclosed my practice fla. import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; import flash.geom.Rectangle; import flash.utils.getTimer; import flash.events.MouseEvent; import flash.text.*; import flash.display.*; TweenPlugin.activate([ThrowPropsPlugin]); var bounds: Rectangle = new Rectangle(100, 100, 1280, 600); var blitMask: BlitMask = new BlitMask(mc, bounds.x, bounds.y, bounds.width, bounds.height, true, false, 0, true); TweenLite.delayedCall(0.1, blitMask.update, [null, true]); blitMask.bitmapMode = false; var t1: uint, t2: uint, y1: Number, y2: Number, x1: Number, x2: Number, xOverlap: Number, xOffset: Number, yOverlap: Number, yOffset: Number; var isMoving: Boolean = false; var isCatched: Boolean = false; blitMask.stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); function mouseDownHandler(event: MouseEvent): void { TweenLite.killTweensOf(mc); blitMask.disableBitmapMode(); if (isMoving == true) { isCatched = true; isMoving = false; } x1 = x2 = mc.x; xOffset = this.mouseX + mc.x; xOverlap = Math.max(0.5, mc.width - bounds.width); t1 = t2 = getTimer(); mc.stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); mc.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); } function mouseMoveHandler(event: MouseEvent): void { isMoving = true; if (blitMask.bitmapMode == false) { blitMask.enableBitmapMode(); } var x: Number = this.mouseX - xOffset; if (x > bounds.left) { mc.x = (x + bounds.left) * 0.5; } else if (x < bounds.left - xOverlap) { mc.x = (x + bounds.left - xOverlap) * 0.5; } else { mc.x = x; } blitMask.update(); var t: uint = getTimer(); //if the frame rate is too high, we won't be able to track the velocity as well, so only update the values 20 times per second if (t - t2 > 50) { x2 = x1; x1 = mc.x; //y2 = y1; t2 = t1; //y1 = mc.y; t1 = t; } event.updateAfterEvent(); } function mouseUpHandler(event: MouseEvent): void { mc.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); mc.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); var time: Number = (getTimer() - t2) / 1000; var xVelocity: Number = (mc.x - x2) / time; ThrowPropsPlugin.to(mc, { throwProps: { x: { velocity: xVelocity, resistance: 50 } }, onUpdate: blitMask.update, onComplete: throwComplete, ease: Strong.easeOut }, 10, 0.3, 1); } function throwComplete() { isMoving = false; isCatched = false; blitMask.disableBitmapMode(); blitMask.update(null, true); } mc.mc_1.addEventListener(MouseEvent.CLICK, onC); function onC(e: MouseEvent) { if (isMoving == false && isCatched == false) { mc.isc.text = "Item Clicked.."; mc.mc_2.play(); } else { mc.isc.text = ""; } } mc.mc_2.addEventListener(MouseEvent.CLICK, onD); function onD(e: MouseEvent) { if (isMoving == false && isCatched == false) { mc.mc_2.play(); mc.isc.text = ""; } else { // mc.isc.text = ""; } } It's supposed to wrap, and then on swipe just glide smoothely to a halt - doesn't matter where - ie not have any bounds. Please help? disableBitmapTest.zip
  7. Hi there, I'm making an installation piece which has a stagesize of 7770x1080 (basically 4 HD touchscreen monitors in a row with 30 px space between each ). I've been looking for a supersimple throwprops example that would just let me drag a movieclip along the x-axis for this, but I can't find one apart from the one on the site, and that one uses blitmask. I'm guessing a blitmask would be counterproductive covering such a stage-size. Is there an example somewhere that you know of that would just permit me to see the syntax for as3 throwprops the way it's featured in the js version of it? I just need to be able to throw a movieclip around the stage to understand it, I think. Basically I would be out of trouble if I understood draggable and throwprops in as3, and I'm pretty lost just using the docs. any help would be appreciated! cheers edit: Oh wow, a mind boggling blitmask of that size isn't such a cpu eater afterall. This is amazing stuff you've built here. I used your example and threw something together I can use. You gentlemen came up with some rather jaw-dropping stuff here. All Hail the Green Sock !
  8. You guys are awesome! Thank you!
  9. Aha! That worked.. although.. if I cant center the object the way it works in the demo swf, I cant use it to make a cool site Im thinking of, which is kind of a sad thing. I tried a few of the other pinpoints, they work... the only one that doesn't work is the center point, and sadly thats the only one I need.. Ive reattached the fla as a cs5 version.. Oh, Great Greensock Gods.. please help
  10. Hi again, this is happening before I view it in html - just regularly exporting it with strg+enter.. tried those settings that you posted as well, but to no avail.. heres my fla.. maybe that can give some insight..?
  11. Thank you for your replies & insights, but it still doesnt work - which is weird. I get no error on export, but my movie still doesn't behave like the demo swf or the url.. meaning my mc snaps to the position allright when I resize - but it's instant, no tween to be seen. import com.greensock.*; import com.greensock.easing.*; import com.greensock.layout.*; var ls:LiquidStage = new LiquidStage(this.stage, 550, 555, 550, 555); ls.attach(mc, ls.CENTER, false, true, 1, {ease:Elastic.easeOut}); por favor, ayuda me?
  12. Hi there, just started experimenting with liquid stage, when I cut n paste the example from the demo-page into my movie and export without having touched the code (aside from importing easing), it throws this error.. Scene 1, Layer 'Layer 3', Frame 1, Line 6 1118: Implicit coercion of a value with static type Object to a possibly unrelated type Number. here's the code: import com.greensock.*; import com.greensock.easing.*; import com.greensock.layout.*; var ls:LiquidStage = new LiquidStage(this.stage, 550, 555, 550, 555); ls.attach(mc, ls.CENTER, false, 2, {ease:Quart.easeInOut}); whereas line 6 is: ls.attach(mc, ls.CENTER, false, 2, {ease:Quart.easeInOut}); I'm wondering what I'm doing wrong? cheers, Jan this is the url of the demo page, in case it matters: http://www.greensock.com/as/LiquidStage/