Jump to content
Search Community

rikbogusz

Members
  • Posts

    13
  • Joined

  • Last visited

rikbogusz's Achievements

0

Reputation

  1. thanks tons, i pm'd my emails to ya this mornin.
  2. hey thanks for replying to such an old discussion. i have buttons that will scale the movieclip up or down, so yes, and that's why i've tried centering. the only real problem is the math stops the movieclip roughly two thirds of the way from the top and from the left edge of the image. here's the full code //////////////////////// VARIABLES; var dragging:Boolean = false; var dragOffsetX:Number; var dragOffsetY:Number; //////////////////////////////////////////// function killMapdrag():void { bigmap_mc.removeEventListener(MouseEvent.MOUSE_DOWN, mapmousedown); activearea_mc.removeEventListener(Event.MOUSE_LEAVE, mapmouseleave); } function initThis():void { bigmap_mc.addEventListener(MouseEvent.MOUSE_DOWN, mapmousedown); activearea_mc.addEventListener(Event.MOUSE_LEAVE, mapmouseleave); } function startDragging():void { dragOffsetX = bigmap_mc.x - mouseX; dragOffsetY = bigmap_mc.y - mouseY; bigmap_mc.addEventListener( MouseEvent.MOUSE_MOVE, MOUSE_MOVE, false, 30 ); dragging = true; } function stopDragging():void { bigmap_mc.removeEventListener(MouseEvent.MOUSE_MOVE, MOUSE_MOVE); dragging = false; } function mapmousedown(e:MouseEvent):void { startDragging(); bigmap_mc.addEventListener(MouseEvent.MOUSE_UP, MOUSE_UP, false, 30 ); } function MOUSE_UP(e:MouseEvent):void { stopDragging(); bigmap_mc.removeEventListener(MouseEvent.MOUSE_UP, MOUSE_UP); } function MOUSE_MOVE(e:MouseEvent):void { if (setXPosition(mouseX + dragOffsetX)) { e.updateAfterEvent(); } if (setYPosition(mouseY + dragOffsetY)) { e.updateAfterEvent(); } } function mapmouseleave(e:Event):void { if (dragging) { bigmap_mc.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_UP)); } } function setXPosition(value:Number):Boolean { var min:Number = activearea_mc.width * 0.5 - bigmap_mc.width * 0.5; var max:Number = 0; if (value < min) { value = min; } else if ( value > max ) { value = max; } if (value != bigmap_mc.x) { TweenMax.to(bigmap_mc,1,{x:value,ease:Expo.easeOut}); return true; } return false; } function setYPosition(value:Number):Boolean { var min:Number = activearea_mc.height * 0.5 - bigmap_mc.height * 0.5; var max:Number = 0; if (value < min) { value = min; } else if ( value > max ) { value = max; } if (value != bigmap_mc.y) { TweenMax.to(bigmap_mc,1,{y:value,ease:Expo.easeOut}); return true; } return false; } initThis(); the image for the map is 5300x3960 and the active area movie clip is 1484x1080. can you tell what i need to change to enable the drag to the left and top
  3. hi ukla, i see this was a few months ago, but in my trying to accomplish this functionality i came across this discussion. for my purpose, i need to have the image centered also, i've tried your suggestion of adding the math to accomodate centering, and it works... mostly. when panning, i can only move about halfway up the movie clip. here's the section of your code, function setXPosition(value:Number):Boolean { var min:Number = activearea_mc.width * 0.5 - bigmap_mc.width * 0.5; var max:Number = 0; if (value < min) { value = min; } else if ( value > max ) { value = max; } if (value != bigmap_mc.x) { TweenMax.to(bigmap_mc,1,{x:value,ease:Expo.easeOut}); return true; } return false; } function setYPosition(value:Number):Boolean { var min:Number = activearea_mc.height * 0.5 - bigmap_mc.height * 0.5; var max:Number = 0; if (value < min) { value = min; } else if ( value > max ) { value = max; } if (value != bigmap_mc.y) { TweenMax.to(bigmap_mc,1,{y:value,ease:Expo.easeOut}); return true; } return false; } can you tell what i might need to change? thanks for sharing
  4. still no sleep, but got it working, your explanation helped. i ditched the whole addchild method, using load() and unload(). i was over thinking it. thanks sooo much!
  5. jack, you rule. i'll try and incorporate yr suggestion with my 3 hours sleep in last 48 hours brain.
  6. i'm getting my head around this, but a few things i still just don't know how to do properly. i've created a loadermax which loads a number of videoloaders, some with audio, some not. in the movieclip, i have buttons to play each clip. i load them and play them ok, but my unloading and removing children skills are pretty weak. it's not really noticeable until a clip with audio is played, then a clip with no audio is chosen, the newly selected clip plays, but the audio from the previously loaded clip plays with it. here's my code var loader:VideoLoader = new VideoLoader("flv/1_form.flv",{name:"videoone",width:870,height:480,scaleMode:"proportionalInside",bgColor:0x000000,bgAlpha:0,autoPlay:false,volume:0,repeat:-1,requireWithRoot:this.root,estimatedBytes:75000}); var loader2:VideoLoader = new VideoLoader("flv/2_drapelift.flv",{name:"videotwo",width:870,height:480,scaleMode:"proportionalInside",bgColor:0x000000,bgAlpha:0,autoPlay:false,volume:0,repeat:-1,requireWithRoot:this.root,estimatedBytes:75000}); var loader3:VideoLoader = new VideoLoader("flv/3_washoff.flv",{name:"videothr",width:870,height:480,scaleMode:"proportionalInside",bgColor:0x000000,bgAlpha:0,autoPlay:false,volume:0,repeat:-1,requireWithRoot:this.root,estimatedBytes:75000}); var loader4:VideoLoader = new VideoLoader("flv/4_coverage.flv",{name:"videofor",width:870,height:480,scaleMode:"proportionalInside",bgColor:0x000000,bgAlpha:0,autoPlay:false,volume:1,repeat:0,requireWithRoot:this.root,estimatedBytes:75000}); var queue:LoaderMax = new LoaderMax({name:"mainQueue",onProgress:progressHandler,onComplete:completeHandler,onError:errorHandler}); queue.append( loader ); queue.append( loader2 ); queue.append( loader3 ); queue.append( loader4 ); function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); } function completeHandler(event:LoaderEvent):void { trace("loading done"); } function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } ch6_btn1.buttonMode = true; ch6_btn1.mouseChildren = false; ch6_btn1.addEventListener(MouseEvent.CLICK, btnDown_ch6_1); function btnDown_ch6_1(e:MouseEvent):void { queue.unload(); queue.load( loader ); var content:ContentDisplay = LoaderMax.getContent("loader"); addChild(loader.content); loader.gotoVideoTime(0, true); } ch6_btn2.buttonMode = true; ch6_btn2.mouseChildren = false; ch6_btn2.addEventListener(MouseEvent.CLICK, btnDown_ch6_2); function btnDown_ch6_2(e:MouseEvent):void { queue.unload(); queue.load( loader2 ); var content:ContentDisplay = LoaderMax.getContent("loader2"); addChild(loader2.content); loader2.gotoVideoTime(0,true); } ch6_btn3.buttonMode = true; ch6_btn3.mouseChildren = false; ch6_btn3.addEventListener(MouseEvent.CLICK, btnDown_ch6_3); function btnDown_ch6_3(e:MouseEvent):void { queue.unload(); queue.load( loader3 ); var content:ContentDisplay = LoaderMax.getContent("loader3"); addChild(loader3.content); loader3.gotoVideoTime(0,true); } ch6_btn4.buttonMode = true; ch6_btn4.mouseChildren = false; ch6_btn4.addEventListener(MouseEvent.CLICK, btnDown_ch6_4); function btnDown_ch6_4(e:MouseEvent):void { queue.unload(); queue.load( loader4 ); var content:ContentDisplay = LoaderMax.getContent("loader4"); addChild(loader4.content); loader4.gotoVideoTime(0,true); } i think what i need to do is load and unload into the same child, but i really haven't grasped how to do that yet. if anyone can help today i'd greatly appreciate it, this is for an application to be used at a tradeshow that starts tomorrow! (and i can't wait til i get paid for this project, it's time to join club greensock!)
  7. TweenMax.allTo([mc_1, mc_2, mc_3], 0.5, {autoAlpha:0,onCompleteAll:myFunction}); i put it behind the right bracket, i can't get it to fire, i put it where its now, i can't get it to fire. i looked at the docs, but i couldn't decipher where it needs to be. thanks!
  8. that worked jack! i downloaded the latest build from the main site, everything's behaving now. i did do that saturday, from a fresh download, but i think i combined one of the older classes in my folder.
  9. i didn't see your reply til today. thanks for the response! i finally slept later that day and did eventually finally sort it out, although in completely different, non-timelinemax manner.
  10. so i'm just starting to play with the new videoloader and loadermax, starting with the example code at http://www.greensock.com/as/docs/tween/com/greensock/loading/VideoLoader.html but i keep getting these errors on complining the swf: /Applications/Adobe Flash CS5/greensock-as3/com/greensock/loading/VideoLoader.as, Line 328 1023: Incompatible override. /Applications/Adobe Flash CS5/greensock-as3/com/greensock/loading/VideoLoader.as, Line 368 1137: Incorrect number of arguments. Expected no more than 2. version 1.18 of VideoLoader.as is being used. what could i possibly be doing wrong?
  11. oh, someone, hellp please? i've been awake for nearly 3 days, finishing building a complex flash app that runs in adobe air. i have a large slideshow incorporated in it, 57 images, 1920x794. i had one working using xml, but it breaks inside the air .app, i rebuilt it sometime this morning using tween max, but, it doesn't loop seamlessly, leaving the screen blank for about 10 seconds, how can i loop it seemlessly and fix the blank space?!?! i'm pretty braindead from lack of sleep, and i just can't wrap my head around fixing the code properly, here's a small sample of my lame code below, please excuse the lack of getting my movie clips in an array, soooo tired..... var pic1:image1 = new image1(); pic1.x = 0; pic1.y = 0; pic1.alpha = 0; var pic2:image2 = new image2(); pic2.x = 0; pic2.y = 0; pic2.alpha = 0; var pic3:image3 = new image3(); pic3.x = 0; pic3.y = 0; pic3.alpha = 0; var clips:Array = [pic1, pic2, pic3]; var timeline:TimelineMax = new TimelineMax({repeat:-1, repeatDelay:1.5}); timeline.insertMultiple( TweenMax.allFrom(clips, 1, {autoAlpha:0}, 5), 1); timeline.insertMultiple( TweenMax.allTo(clips, 1, {autoAlpha:0}, 5), 5.8);
×
×
  • Create New...