ActionScript 2.0 :: MX - Dragging Zooming Locking A MC?

Aug 19, 2009

Being adventurous I've got (all built in AS1) a masked area that you can view an image in. I'm trying to make it so you can zoom it in and drag it around, within the masked area, but the dragging locks it so that you can't drag it to the point where it leaves the edge of the masked area - if you follow. So when you're zoomed in, the iamge is never allowed to be dragged off so far that it's not filling the masked area. I've tried all sorts of code and the following code seemed to work well

Code:
// imageMC = the clip being scaled/repositioned/dragged
limitLeft = 0-Math.round(imageMC._width-maskWidth);
limitUp = 0-Math.round(imageMC._height-maskHeight);
limitRight = 0;
limitDown = 0;
imageMC.startDrag(false,limitLeft,limitUp,limitRight,limitDown);

But since the border size around the image is adjustable (it could be 2, it could be 20) and that eats into the area used to show the image (eg image is offset by imgBorderSize and shrunk by imgBorderSize*2) I tried to factor that into the formulas because once I turned the borders up the above formulas wasn't working right anymore

Code:
// imageMC = the clip being scaled/repositioned/dragged
limitLeft = 0-Math.round(imageMC._width-maskWidth)-(imgBorderSize*2);
limitUp = 0-Math.round(imageMC._height-maskHeight)-(imgBorderSize*2);

[code]....

I also tried to make it so when you zoom in, it zoomed in on the center of the area you can see through the mask, not on the top left - so repositioning is occuring alongside the scaling for the zoom to try and acheive that. Nothing clever, just :

Code:
// ZoomCalc range = 0-100;
// imageMC = the clip being scaled/repositioned/dragged
imageMC._xscale = 100+(2*ZoomCalc); // 100% - 300%

[code]....

When it zooms out however it'd be nice if it didn't snap back to center via the above code, eg if yu're zoomed into bottom left it would stay viewing bottom left as it zoomed out - yeah?If anyone has ANY input to this I'd greatfuly welcome it :/ If I manage to get it working then I have to figure out what my layer above all these layers with clickable buttons don't work as soon as I implemented the dragging of the image layer Is there no way to have buttons on something that is being dragged? ((

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Locking Path Like Locking Root?

Dec 16, 2011

lets say i have a file system like this:

Main.swf
/myfolder/Sub.swf
/myfolder/Sub.php

what if i need the Sub.swf to always find the native php file eather it gets loaded into main.swf or gets played from local folder and i can't use full paths. is it possible to load Sub.swf into Main.swf and make sure that Sub.swf still thinks /myfolder/ as home?

View 2 Replies

ActionScript 1/2 :: Zooming In And Then Zooming Out In (Without Scaling The Image)?

Feb 27, 2012

Basically I want to know if there is a way to go from a zoomed in version of something, and then seeing the whole image in another frame. (By pressing a button)

Let's say there's a tree, I would bascially like (upon pressing a button which I can do) to zoom out and see the whole scenery. Is there a way I can do this without actually changing the size of the image?

View 2 Replies

Professional :: Animations: Zooming In And Zooming Out?

May 25, 2011

I look at professional animations and notice the camera-like effects they manage to put into these animations. I'm wondering how I can do the same without having to just enlarge or reduce a movieclip across the stage. Is there any way to add a camera view on your animations or do you just have to bear with Flash's basic necessities?

View 1 Replies

ActionScript 3.0 :: Locking Stage In Flash?

Feb 12, 2009

Im creating a little flash swf for a website of mine, but when i zoom in or out of the website (ctrl, +) the text moves and you can see outside elements of the canvas. what is the code to lock the canvas?

i thought i was: stage.scaleMode = StageScaleMode.NO_SCALE; but that isnt doing anything.

[URL] shows you what i mean, it is the text at the top that starts with loading...

View 2 Replies

ActionScript 2.0 :: Locking The Window Size?

Oct 14, 2005

looking to lock the window size, of the htm pages that hold the swfs. i know there is a way to do it an i have it at home. only thing is im not at home. does anyone have the script that locks the browser window size. or know where i can get this.

View 1 Replies

ActionScript 3.0 :: Flash Locking A MC To A Path

Jun 30, 2010

I'm trying to find a way to lock a MC (or any other instance) to a path. Best way to describe what I want to do is ... imagine there's a drawn out rail track (the path), and at the press of a button a train (MC) will constantly move along the path until the button is pressed again.

View 4 Replies

ActionScript 2.0 :: CSS Locking Input Textfield?

Nov 3, 2004

I want to style input text, so i created a stylesheet.I made a input textfield, loaded the external stylesheet, defined the textfields stylesheet, and boom it works.Except, i cant type anything into the text field.

View 1 Replies

Professional :: Locking Appears Not To Protect A Layer?

Jan 6, 2010

I thought from other adobe products that the lock would protect any layer you put it onHowever, In a situation where layer 1 is a looping background.Once setup, I locked itNow working on layer 2 but I notice unless I'm very careful I'm still able to move the background (layer 1) while working on other symbols that go on top of background. (even though the lock is in place.So I thought well what good is that, so hide the layer

View 4 Replies

ActionScript 3.0 :: Locking Viewing Size Of Swf File

Oct 30, 2009

I am designing a website using the combination of Dreamweaver with some flash swf files inserted. The page template is actually a very long vertical jpeg that will be imported at the end of my flash swf file. It is a very vertically long file so when the view gets to the page, they will be able to scroll down seeing only white the whole 2 seconds of animation before the page fades into view.

I am going to learn how to use action scripts to allow the viewer to to scroll up and down within that swf file that is imput in a 1row 1 column table in dreamweaver. Does this make any sense to anyone? The file is vertically long so it stretches the table all the way down when viewing in a web browser. I need to know how to lock the finalized physical view of the swf file. Then use action scripts to scroll down and up the length inside of the window, yet keeping the outer actual pixel size locked.

View 1 Replies

ActionScript 2.0 :: Locking Y Coords On Dynamic Scroller?

Feb 26, 2010

I have an image gallery that loads images/text through xml, but I'm having an issue with the scolling, I need to lock the ymouse coords right now it scrolls only on the xmouse, basically I need it to work in the scrolling area only, say 400width by 200height..

[Code]...

View 0 Replies

ActionScript 3.0 :: Locking A Button Until Content Has Been Viewed?

Sep 22, 2010

I am currently building an assessment in flash using AS3. I want to have all navigation buttons visible on the main screen, including the "assessment" button where users will go to sit an assessment based on the content they just viewed.

how can I lock the assessment button until all the other pages containing the content has been viewed? A bonus would be a pop saying something like "Please view content first" appearing when they try to click it.

View 4 Replies

ActionScript 2.0 :: [F8] Locking Orientation In Fullscreen Mode

Mar 10, 2011

I'm trying to design a tablet flash applet. Does anyone know how to lock the orientation of the html embedded player player in landscape mode when it has been full screened? So far this is what I have in the html file: HTML Code: <embed src="fullScreenTest.swf" allowFullScreen="true" fullScreenOnSelection = "true" />

That did wonders for maximing the flash window, but the moment I change orientation on the tablet the flash player also changed orientation. I know there is a way of locking the orientation to landscape mode in ActionScript 3, but is there an ActionScript 2 equivalent for it?

View 0 Replies

ActionScript 2.0 :: Controlling Nested MC And Locking A Frame In It?

May 17, 2004

I've got different skins on my flash site. the site becomes skinned when a user clicks a skin button and the related MC's in my movie go to the appropriate labelled frames with the .png graphics for that skin.

I pretty much just use go to and stop for that and it works great on static (non-animated MC's). I've got one situation though where my MC is animated (it slides up and out of the way to reveal content underneath).I need to be able to tell that MC to go to and stop on the correct frame and then STAY THERE! I'm having trouble figuring out how to make it stay there. At present it defaults back to its first frame whenever it is tweened (animated).

View 6 Replies

ActionScript 2.0 :: [FMX] Locking A Movie Clip's Position?

Oct 20, 2004

I'm an ActionScript beginner, by the way.

I have a simple drag and drop interface, fill in the blank type thing, and I wat to lock a specific move clip's position once it's dropped in the appropriate place. Make sense?

View 1 Replies

ActionScript 2.0 :: Stylesheet Locking Input TextField

Nov 30, 2006

I've just discovered that using a stylesheet on an input textfield renders it uneditable. Does anyone one know of a work-around? Trying to build a text editor for a backend project, but it seems to have crashed before takeoff.

View 1 Replies

ActionScript 3.0 :: Flash Video Locking My Browsers?

Oct 8, 2009

I am working on a video widget, but anytime I try to load any flash video my browser locks, rendering it useless. I've tried some other sites, and they all lock as well. GMail locks trying to load the chat, because of the video chat inside GMail.I've restarted my machine, reinstalled the flash debugger version, and still, I keep having this problem, which is KILLING me...

View 1 Replies

ActionScript 3.0 :: Flash Locking Letter Spacing?

Feb 27, 2011

I have a textbox on the stage where its letter spacing is set to 4. When I change the textbox content with code the letter spacing goes back to 0.

So is there a way to lock the text spacing or do I have to create a textformat and keep resetting the text spacing?

View 3 Replies

ActionScript 2.0 :: Controlling Nested MC And Locking A Frame In It

May 17, 2004

I've got different skins on my flash site. the site becomes skinned when a user clicks a skin button and the related MC's in my movie go to the appropriate labelled frames with the .png graphics for that skin. I pretty much just use go to and stop for that and it works great on static (non-animated MC's). I've got one situation though where my MC is animated (it slides up and out of the way to reveal content underneath). I need to be able to tell that MC to go to and stop on the correct frame and then STAY THERE! I'm having trouble figuring out how to make it stay there. At present it defaults back to its first frame whenever it is tweened (animated).

View 6 Replies

ActionScript 2.0 :: [FMX] Locking A Movie Clip's Position

Oct 20, 2004

I have a simple question, but for the life of me I can't figure it out. I'm an ActionScript beginner, by the way. I have a simple drag and drop interface, fill in the blank type thing, and I wat to lock a specific move clip's position once it's dropped in the appropriate place. Make sense?

View 1 Replies

ActionScript 3.0 :: Flash Loader In Firefox Locking Up On The First Frame?

Feb 8, 2010

im doing a website and using a flash header. this has some movie clips and it needed a loader. in Firefox it will lock up when clicking from page to page and stop on the full loader bar. im using cs3 master collection and as3 the website is paradisebeergarden.ph this is driving me nuts as it is only doing this in Firefox!

View 4 Replies

ActionScript 2.0 :: [Flash 8] Locking Orientation In Fullscreen Mode

Mar 10, 2011

I'm trying to design a tablet flash applet. Does anyone know how to lock the orientation of the html embedded player player in landscape mode when it has been full screened? So far this is what I have in the html file:

HTML Code:
<embed src="fullScreenTest.swf" allowFullScreen="true" fullScreenOnSelection = "true" />

That did wonders for maximing the flash window, but the moment I change orientation on the tablet the flash player also changed orientation. I know there is a way of locking the orientation to landscape mode in ActionScript 3, but is there an ActionScript 2 equivalent for it?

View 1 Replies

AS3 :: Flash Alternative To Locking File Type On FileReference.save

Jun 30, 2011

limiting or correcting the behaviour of FileReference.save isn't possible.Can anyone suggest an alternative (server is Apache/PHP) that matches all of my criteria from this post and avoids the pitfalls I discussed with Jacob?I'm saving an image from my AS3 app using FileReference.save(). This is the code, which works fine:[code]This opens up the save file dialog as expected. I'm using this rather than sending the byteData to PHP because I want the user to have a familiar dialog box that lets them set their own file name.

The problem comes when users have their operating system configured to display file extensions, like I do. This means that in the save dialog the file name contains the extension as seen in the image below, and so it is very easy for the user to delete that extension when they rename the file. Because the default file type for this box is 'All files', if the extension is deleted the file is saved with no type.I don't know of any way to force a file type on the save dialog (if there is one that would be my preferred route) so failing that can anyone suggest a safe way for me to do this that still allows the user to set the file name themselves using a standard dialog for their OS?I did try putting in a call to FileReference.browse() before the save() as shown in this tutorial, but that throws an error because you can only perform one FileReference call at a time.

View 5 Replies

ActionScript 3.0 :: Cursor Locking Up Upon Clicking A Movie Clip Button

Sep 30, 2009

I have a custom cursor that locks up upon clicking a movie clip button. The move clip is slightly different in that it is an invisible button that has other animations locked to its position as child states. This is due to me wanting the user to be able to drag the box you see in the file.The problem is most likely the way the parent child system is set up as I am unable to get the top position mouse event to work on it either yet it works fine on the green box I quickly made within this swf.

View 0 Replies

ActionScript :: Navigating Long Scripts By Locking Selections (Collapse/Expand)?

Oct 11, 2010

if there's one thing i miss about native programming for Mac OS X using Objective-C and XCode, it's the ability to set #praga marks (essentially bookmarks) to easily navigate thru long scripts via the pull-down menu.

in Flash Authoring CS5 i can can collapse/expand selections of code, but these are removed when the selection is removed - whenever an edit is made. using collapse/expand selections would be an ideal equivalent to XCode's #pragma marks if it was possible to lock these sections so they don not disappear when the selection disappears, but as far as i know it's not possible?

View 1 Replies

Zooming To Certain Map Locations?

Oct 27, 2009

how to zoom into(hence zooming the map outward) set locations on a map, yet only those locations. I have a script which will zoom to your mouse location and also if I set the specific x and y, but still zooms when clicking on any other spot.

how do I zoom to only a set location and nothing else within a map/image.

View 38 Replies

Professional :: Zooming In/out On One MC Of Many?

Jan 11, 2010

I'd like to have my viewers mouse over any of the MovieClips on the scene and using the keyup / keydown have only that MC scale up or down.  The scaling should only effect the moused over MC.Here is what I'm using for the scaling on one MC now...
 
var Listener:Object;Listener = new Object();Listener.onKeyDown = function(){    if (Key.isDown(Key.UP))     {                    container._xscale = container._xscale + 10;            container._yscale = container._yscale + 10;    }     if (Key.isDown(Key.DOWN)) {                    container._xscale = container._xscale - 10;            container._yscale = container._yscale - 10;    } };Key.addListener(Listener);

View 2 Replies

ActionScript 2.0 :: Zooming In And Out A Swf Using AS Or Anything

Aug 2, 2002

I was just working on trying to zoom a flash movie using JS but cant seem to get it and it is driving me nuts any of you guys know how I can zoom in and out on a movie using action script.

View 2 Replies

ActionScript 2.0 :: Zooming In And Out?

Feb 22, 2006

I need some help with creating two buttons that zoom in and out of a movieclip.I have seen some tutorials and tried them, but got really confused.My problem is that the movieclip i want zoomed (in & out) is embedded inside another movieclip, so don't know how to refer to it.

also where should i declare the zoom function?? on the movieclip or on the main timeline?? the buttons that control the zoom in and zoom out are on the main timeline.

View 1 Replies

ActionScript 1/2 :: Web Flash Zooming In/out?

May 27, 2009

I am a really new flash beginner, and I am trying to write a site that can do this scaling in/out effect (Not an image) after when a new file is loaded into the page. I've googled and searched everywhere and couldn't find a possible solution to this.You can see the site, there is a zoom in and moving effect after a button/new page is loaded.
 
Here are the scaling, I am talking about:http:[url]....

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved