Is it possible to get information in swf from a browser that resizing process is finished?
2 января 2012 г. 18:26 пользователь natalia Vikhtinskaya <[email protected]> написал: > Yes, you are right. Thank you very much. > I added isDrag var > so: > setMouseController=function(){ > mouseController.onMouseDown = function(){ > isDrag=false; > yOff=container_mc._y -_ymouse; > mouseController.onMouseMove=moveIt;}} > > function moveIt() { > isDrag=true; > ..................///move screen > } > > and > mc.bg.onRelease=function(){ > if (!isDrag){ > > ......... //zoom picture > } > } > > Now dragging is perfect. > > The only question I still have is resizing layout when pictures are not > zoomed. > How to catch event when resizing is finished? I see that they do that > somehow. And how calculate number and size of the pictures in the > row. It depends on the stage size but I don't see logic. This magic I > don't understand at all. > > > 2 января 2012 г. 17:19 пользователь Cédric Muller <[email protected]> > написал: >> Hi >> >> the 'release event' (leading to zooming) only occurs when you 'drag' and >> then 'release' on the same image. If you drag an image (f.ex nb 16) and >> release your mouse on nb 15, everything works fine. >> You should try a simpler solution where you validate a click by looking at >> the time between the mouse down and the mouse up (drag + release) events, or >> something along those lines. >> You seem to be checking whether the mouse still is on the same image, if >> that is true, regardless of the mouse movement/time spent dragging, the >> release event occurs. >> >> You could also add a param like 'isDragging=true/false'. >> >> hth, >> Cedric >> >> >>> Thank you for help. >>> I created prototype http://www.mightybook.com/test/ >>> that works similar to >>> >>> http://www.zara.com/webapp/wcs/stores/servlet/category/us/en/zara-us-W2011-s/149501/ >>> (page "event") >>> >>> 1. Sometimes an event "release" invokes when I press a mouse longer >>> trying to drag screen and move mouse slow. Another words sometimes I >>> zoom picture at the end of the movement. >>> Example page works perfect with draging screen. >>> >>> How can I improve drag function for screen? >>> >>> Here is some code >>> setMouseController=function(){ >>> mouseController.onMouseDown = function(){ >>> yOff=container_mc._y -_ymouse; >>> mouseController.onMouseMove=moveIt;} >>> } >>> >>> mouseController.onMouseUp = function(){ >>> delete mouseController.onMouseMove; >>> } >>> >>> function moveIt() { >>> var thisY=(yOff+_ymouse); >>> if(thisY <= yMin) >>> thisY = yMin >>> if(thisY >= yMax) >>> thisY = yMax; >>> Tweener.addTween(container_mc, { _y:thisY, time:1, >>> transition:"easeOut",onComplete:finishMoveTween}); >>> >>> } >>> >>> >>> initPicAction=function(){ >>> for (var i:Number=1; i<=lastNumber; i++){ >>> var mc:MovieClip=container_mc["pic"+i]; >>> mc.picNum.text=i; >>> >>> >>> mc.bg.onRelease=function(){ >>> currentPic=this._parent; >>> Tweener.removeTweens(container_mc); >>> delete mouseController.onMouseMove; >>> delete mouseController.onMouseDown; >>> placeZommedPicture(); >>> >>> } >>> >>> } >>> } >>> >>> placeZommedPicture=function(){ >>> if (!scaled){ >>> var >>> targetXScale:Number=container_mc._xscale*scaleFactor; >>> var >>> targetYScale:Number=container_mc._yscale*scaleFactor; >>> scaled=true; >>> Tweener.addTween(container_mc, >>> {_xscale:targetXScale,_yscale:targetYScale, time:0.5, >>> transition:"easeOut",onComplete:finishTween}); >>> } >>> var >>> targetX:Number=Math.round(centerX-currentPic._x*scaleFactor); >>> var >>> targetY:Number=Math.round(centerY-currentPic._y*scaleFactor); >>> Tweener.addTween(container_mc, {_x:targetX, >>> _y:targetY, time:0.5, >>> transition:"easeOut",onComplete:finishTween}); >>> >>> } >>> >>> initPicAction(); >>> setMouseController(); >>> >>> 2. I see that objects lay out AFTER swf is resized. How that >>> possible? >>> I know that stage.onResize function invokes when swf IS RESIZED. >>> >>> >>> >>> >>> >>> >>> 27 декабря 2011 г. 18:30 пользователь Geografiek >>> <[email protected]> написал: >>>> >>>> At first I thought no, but maybe you do. >>>> Here's some code I used for zooming >>>> >>>> var oldScale:Number; // initial scale of the _dpoToZoom >>>> var newScale:Number; // target scale of the _dpoToZoom >>>> var scaleFactor:Number = newScale/oldScale; >>>> var globalMouse:Point = new Point(stage.mouseX, stage.mouseY); >>>> var localMouse:Point = _dpoToZoom.parent.globalToLocal(globalMouse); >>>> var deltaX:Number = localMouse.x - _dpoToZoom.x; >>>> var deltaY:Number = localMouse.y - _dpoToZoom.y; >>>> var newX:Number = Math.round((localMouse.x - (deltaX * scaleFactor))); >>>> var newY:Number = Math.round((localMouse.y - (deltaY * scaleFactor))); >>>> TweenLite.to(_dpoToZoom, _tweenDuration, { >>>> scaleX:_currentScale, >>>> scaleY:_currentScale, >>>> x:newX, >>>> y:newY, >>>> ease:Cubic.easeOut, >>>> }); >>>> >>>> HTH >>>> Willem van den Goorbergh >>>> >>>> On 27 dec 2011, at 15:19, natalia Vikhtinskaya wrote: >>>> >>>>> Thank you. Should I convert local x.y to Global x,y for clicked mc? >>>>> >>>>> 27 декабря 2011 г. 17:02 пользователь Geografiek >>>>> <[email protected]> написал: >>>>>> >>>>>> Hi Natalia, >>>>>> Yes I think that's the general idea. The math is really not that hard. >>>>>> just scaling (always the same) and moving (relative to the position of >>>>>> the picture clicked) >>>>>> Grab paper and pencil and visualize what you want to achieve to get >>>>>> your calculations started. It really helps. >>>>>> success >>>>>> Willem van den Goorbergh >>>>>> >>>>>> On 27 dec 2011, at 13:08, natalia Vikhtinskaya wrote: >>>>>> >>>>>>> Hi >>>>>>> I want to create image grid with zoom effect similar to this >>>>>>> >>>>>>> http://www.zara.com/webapp/wcs/stores/servlet/category/us/en/zara-us-W2011-s/149501/ >>>>>>> Click on "event". I need an advice how to place >>>>>>> >>>>>>> If I create a grid inside one mainMc how I can manage it? I need to >>>>>>> zoom this mainMc, move all images but clicked image must be in the >>>>>>> centre of the screen. Is this correct idea in general? How to make >>>>>>> calculation? What is the way to solve it? >>>>>>> >>>>>>> Thank you for any help. >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Flashcoders mailing list >>>>>>> [email protected] >>>>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= >>>>>> Geografiek is een in Utrecht gevestigd kartografisch bureau >>>>>> Willem van den Goorbergh is telefonisch bereikbaar onder nummer >>>>>> 030-2719512 >>>>>> of mobiel: 06-26372378 >>>>>> postadres: Hooghiemstraplein 89 3514 AX UTRECHT >>>>>> Bezoek onze website op: www.geografiek.nl >>>>>> twitter: @wvdgoorbergh >>>>>> =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Flashcoders mailing list >>>>>> [email protected] >>>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >>>>> >>>>> >>>>> _______________________________________________ >>>>> Flashcoders mailing list >>>>> [email protected] >>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >>>> >>>> >>>> =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= >>>> Geografiek is a Dutch, Utrecht-based map and chart design company. >>>> Willem van den Goorbergh can be contacted by telephone: (+31)30-2719512 >>>> or cell phone: (+31)6-26372378 >>>> visiting address: Hooghiemstraplein 89 3514 AX UTRECHT >>>> Visit our website at: www.geografiek.nl >>>> twitter: @wvdgoorbergh >>>> =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Flashcoders mailing list >>>> [email protected] >>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >>> >>> >>> _______________________________________________ >>> Flashcoders mailing list >>> [email protected] >>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> >> >> _______________________________________________ >> Flashcoders mailing list >> [email protected] >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

