ActionScript 3.0 :: Centre Of Map Remains Centered During Map Scale?

Oct 28, 2011

I've created an mc which functions as my map and controls to go with that which allow the map to be moved around and key points navigated to and zoomed in on at varying zoom levels.I'm using scaleX and scaleY to scale the map mc and a list of x and y positions to correctly position the map for each key point. The map mc starts at 1:1 scale ratio with the screen and it's registration point is at 0,0.When I want to go to a certain area I perform this calculation (offsetX and offsetY are the center of the screen and posX and posY are predined offsets on the map):[code]

I now need to implement a zoom in / out function and this is what I'm struggling with. The zoom should use the center of the screen as the reg point for the scale, so I've been trying something along the lines of the following to get the correct x and y position to set after the scale:[code]I know this is wrong but I've shown this to give you an idea of my train of thought, I need to work out what the new x and y will be to ensure that the area that is being zoomed in on, stays in the center of the screen.So in my mind this gets the distance from the current position of the map relative to the center point of the screen (offsetX, offsetY) then scales that distance by the new scale.

View 6 Replies


Similar Posts:


AS3 :: Auto-Centre - MovieClip Always Stays In The Centre Of The Stage On Resize?

Jul 22, 2009

Just a quick one. Using AS3, how would I ensure that a movieClip always stays in the centre of the stage on resize?

View 1 Replies

ActionScript 2.0 :: Rolledover Clip To Scale Up And All The Others To Scale Down And Blur?

Mar 8, 2007

Scenario: main moveiclip with 4 other clips in it. I want the rolledover clip to scale up and all the others to scale down and blur.

Question: What is the most effiecent way to code this. Would it be a "for in loop"? I am trying to minimize the code and would rather not use a whole bunch of if then statements.

View 3 Replies

IDE :: Flash Content To Scale When Scale Browser Window?

Feb 19, 2010

I want my flash content to scale when I scale my browser window.

View 5 Replies

ActionScript 3.0 :: Button That Remains Pressed?

Jul 20, 2010

i have a movieclip with some buttons with blur, when you rollover on them they become normal, when you rollout they return blur.

what i would like to do is that when you press on of them it becams normal and remain in that state untill you press on onother button.

Is there a way to do this? maybe something that prevent onRollOut when you pressed the button?

My code:

Code:
import gs.*;
this.buttonMode = true;
TweenMax.to(this, 0.5, {blurFilter:{blurX:5, blurY:5}});

[Code].....

View 10 Replies

ActionScript 2.0 :: XML Data Remains Through Scenes

Jun 10, 2008

Using Flash 8, AS 1/2. Here's what I'm trying to do... I've got a slide show sort of thing. Five different scenes. You can navigate scene to scene with simple button navigation. One half of the slide show displays a constant image. The other side displays a different image depending on the scene you're in. Along with each different image, there is a caption for each image. When you click on the caption, text from an external XML file is displayed.

I got that far, and I thought everything was working perfectly. Then I changed scenes. The scenario I'm at right now: Scene 1 loads. I click on the caption. The text from the external XML file displays. Click the navigation button to go to Scene 2. The text from the external XML file that displayed when I clicked Scene 1's caption is displayed. If I click through the rest of the scenes, the text that was displayed when I clicked on Scene 1's caption is displayed throughout. What I need is this: When I click the caption in Scene 1, the text should appear in show_desc. When I go to another scene, there should be no text unless I click on the caption for that scene. I'm not sure how to accomplish this, and I've been trying everything I could think of/could find with no success.

EDIT: I figured out that problem, sort of. The caption is set as a button. It's got an onRelease function, so when it is released, it displays the XML data. I had a function wrapped around the first function, which delayed the XML-display function by one second. It seems that, with that function added in, it was just continually asking for the XML data over and over and over again. The thing is, I do need that delay to occur. What I was using before was:

[CODE].....

View 14 Replies

ActionScript 1/2 :: When Press A Button, It Remains Pressed?

Nov 4, 2009

how do I join so that when you press a button, it remains pressed?

View 1 Replies

ActionScript 3.0 :: Sound From The Flv Remains Their And My Bg Music Not Playing Also?

Sep 3, 2010

i made a webiste with bg sound, home, portfolio, gallery, contcts. This are the links. when click portfolio, which contain a flv file, when clicking the flv file bg music stop and video will play smoothly.But if i navigate to other links the sound from the flv remains their and my bg music not playing also..

View 1 Replies

ActionScript 1/2 :: Action Pannel Remains Hidden?

Jul 3, 2011

how to get the action pannel displayed again???? It worked until this morning, and then quit. I tried clicking both  F9 and window/actions, no luck though. I have reinstalled Flash, restarted my PC. Same.

View 2 Replies

Actionscript 3 :: Flash Cursor Remains Arrow?

May 20, 2011

I've got an actionscript project (code I inherited) in which the cursor remains an arrow at all times. Even when I set a Sprite's buttonMode, nothing changes.

mySprite.buttonMode = true;
mySprite.useHandCursor = true;
mySprite.mouseChildren = false;

I've searched the project for terms like 'cursor' and the above 3, but I can't find anything.Is there some global setting somewhere that disallows cursor modification?

View 1 Replies

Flash :: Object Remains On Stage After RemoveChild()?

Nov 21, 2011

I am using removeChild() to remove a MovieClip. And via tests, I can confirm that it's working fine ( stage.contains(mc) returns false ). But the MovieClip still does not seem to be removed, as if the stage is not updated correctly.

View 1 Replies

ActionScript 3.0 :: UI Loaders And Flv Files - Sound Remains

Feb 24, 2011

I loaded a flv into a uiloader. I have 4 buttons which load different projects in. A quiz, an animation and a video. Works great apart from when you click the buttons either the flv sound remains or if you click the flv button I have multiple instances of the audio. The main file AS3 is

[Code].....

View 0 Replies

ActionScript 3.0 :: RemoveChild But Mouse Remains Over/active?

Jan 3, 2010

I have a button on screen which is removed with removeChild when a certain timer event fires. However, if my mouse is on top of this button when the timer goes off, the button is removed but the mouse remains active (it's still a little hand cursor) and as soon as you move the mouse at all, the button fires its MOUSE_OUT event.

What I would like to happen is for the button to disappear and if the mouse is above it the mouse will simply go back to an arrow cursor and most importantly the MOUSE_OUT event won't be fired (in my case the event triggers a sound effect).It seems to me that the way to make that happen would be to set my button to null. However I use this button every time the user completes a level so it seems wasteful to null it and rebuild it ever time when i can simply add/remove it.

View 7 Replies

ActionScript 2.0 :: Initialize X Scale And Y Scale Into Percentages?

Jan 14, 2006

How can I convert the current scale of the instance to 100% so I can easily "visualize" and manage the instance when I modify its scale? Here's the actionscript, it works, but I just want the temp._xscale and temp._yscale to be in percentages, not real numbers.

Code:
USflag.onMouseDown = function ()
{
var temp = USflag;
onEnterFrame = function ()

[code]....

One last thing, what's the tag you have to put that is designed for boxing actionscripts? I'm suing [ code ][ /code ]

View 1 Replies

Disable The Hand For A Button Instance So The Pointer Remains?

Aug 20, 2009

how do you disable the hand for a button instance so the pointer remains? this is for AS3.

View 7 Replies

Professional :: If Go Fullscreen When Viewing An Flv The Video Remains On The Stage

May 5, 2011

I've used a standard skin on an FLVplayback component which loads and plays perfectly. The problem arises when I enter fullscreen mode and then leave it again. Once I've done this, the video remains on the stage irrespective of what frame I'm on. I can even change scenes and the video remains in the middle. I haven't even added the video using actionscript so I don't really understand how it could possibly stay on more than the frame its inserted in!? At the moment I've used no ActionScript to control the video. I apologise if I'm missing something, this is the first time I've dealt with videos.

View 8 Replies

Professional :: FLVplayback Window Disappears But Sound Remains?

Mar 29, 2012

I'm using Flash CS5 and Actionscript 2. I'm created a multi page training document with some pages containing videos. I have a set of XML program generated videos that work great until I use removeMovieClip(); when exiting the page.  I use this to kill the video before I get the the next page.When I come back to the page the code I have regenerates the list. But when I play the videos I only get sound and no video. Sometimes the video black window appears and then immediately disappears or nothing appears but the sound starts playing.
 
Here are the relevant pieces of code: 
import mx.video.*; 
//Creating the mc which will contain the FLVPlaybac 

[code].....

View 7 Replies

Actionscript 3 :: Xml Array Of Objects Parsed From XML Remains With Zero Length?

Apr 9, 2010

I'm trying to parse an XML file and create an object array from its data. The data is converted to MediaAlbum classes (class of my own). The XML is parsed correctly and the object is loaded, but when I instantiate it, the Albums array is of zero length, even when the data is loaded correctly.I don't really know what the problem could be

import Nem.Media.*;
var mg:MediaGallery = new MediaGallery("test.xml");
trace(mg.Albums.length);

[code].....

View 1 Replies

ActionScript 3.0 :: Button Rollover State Remains On Rollout?

Feb 9, 2009

I'm in the process of building a Flash AS3 navigation for a client's website. The horizontal navigation has five main links, and a secondary navigation will drop down under three of them on rollover (this part isn't complete yet). The rollover and rollout states are animated: on rollover they gradually change color; on rollout they gradually change back to the original color.Well, I've finally gotten the code figured out (my first foray into AS3 after finally being comfortable with some things in AS2!). However, depending on how you move the mouse (i.e., if you move the mouse over the button too quickly), the rollover state remains on rollout and I can't figure out why. Can someone help? I also need to know how to designate an active state when the button is clicked (say, if you clicked on Projects, the Projects button would be highlighted (the rollover state) when you're on that page.The link to the in-progress navigation is located here: http:[url].... And this is the AS:

var homeLink:URLRequest = new URLRequest("../index.htm");
var mySound:Sound = new clickSound();
home_mc.buttonMode = true;[code]......

View 0 Replies

ActionScript 2.0 :: Get A True Invisible Button That Still Remains Clickable?

Apr 22, 2003

without using alpha 0% in Flash5

this is the problem.

i want to make a button invisible. however, since using alpha 0% will create colordifferences with 16bit colors, I want to use _visible = "0"; (like you would on a MC).

one option is to put a MC inside the button and make that invisible, but obviously you can't without an onClipEvent handler, but if you do so, it doesn't work.

puting the button inside a MC is the second option, and with the _visible command it works... however, it also stops the button from working.

is there a way to get a true invisible button that still remains clickable????

View 3 Replies

IDE :: RemoveChild - Videos Load But Audio Remains From Previous SWF

Jun 30, 2009

I've got a SWF loading others SWFs with this code:

[Code]...

Videos load, but audio remains from previous SWF. I thought removeChild would take care of it.

View 3 Replies

ActionScript 3.0 :: Get Map Centre Zoom Accordingly?

Oct 23, 2009

I have multiple points on a Google map that i need to pinpoint.How would i find the two points that are farthest away from each other and get my map center an zoom accordingly?[code]Just copy and paste into root time line to test

View 1 Replies

IE Ignores Flash Width/height, Display Remains Small?

Feb 26, 2012

[URL]how do i stretch the movie to fill the entire white area which is set to be 500 to 350 px (please see pic)

the code:

<object type="application/x-shockwave-flash" data="videos/player.swf" width="500" height="350">
<param name="movie" value="videos/player.swf">
<param name="quality" value="Best">
<param name="allowFullScreen" value="true">

[code].....

View 2 Replies

ActionScript 3.0 :: A Stage Instance Named Remains Null To The Frame?

Jun 6, 2011

For some reason, no matter what I try, a stage instance named 'track' remains null to the frame it's on. I've made sure that Auto-declare stage instances is checked. Is anyone familiar with this problem?

View 1 Replies

ActionScript 2.0 :: External XML Loads But Content Variable Remains Undefined?

Sep 5, 2005

what i have got is an external XML file that loads the news data into flash where it is there parsed and assigned to a dynamic text box and styled with a style sheet. Through trace() if found the xml gets loaded properly but when i upload it to a webserver it does not always load. Many times the variable just reads out undefined. If i refresh it a few times it will eventually load. This is not acceptable of course. It needs to try until it loads. I thought i had the code to make this happen but Im afraid im mistaken.here is the code, its inside the first frame of a simple swf with only the dynamic text box.

Code:
stop();
trace("1");

[code]......

View 4 Replies

ActionScript 2.0 :: Gradual Centre On Screen?

Mar 9, 2005

I have seen a couple of flash movies of late that have a nifty element to them, when the user resizes his window the movie slides to the centre or relative position, rather than snapping.THIS SITE is one example of the effect I mean When you resize your window the text moves gradually to a relative position.How is this done? is it via action scripting or through the html/java?It is a nice little touch, I like it. Do you think if you can dictate the position of certain elements you can dictate the size of elements according to window size?

View 9 Replies

ActionScript 2.0 :: Mouse Follow From Centre

Feb 12, 2009

Using this code:

[Code]...

I have a compass that is rotating depending on the position of the mouse, however it rotates it from the top left of the stage not the movie clip, how to get the AS to recognise the centre of the compass.. Also, I thought a nice touch would be if the compass had a slight "wobble"

View 1 Replies

ActionScript 2.0 :: CS3 Use Stage Centre Not Top Left?

Sep 13, 2010

i am struggling to work something out here and am hoping that someone on here can put me right...i have a flash movie that uses a liquid type layout (ie all from top left to fill the stage) - part of the movie is a navigation that when clicked slides around the stage to set positions.the problem is that the nav co-ordinates (points it travels to) are all based around top left of the stage, and i need to make it work from the centre of the stage.this is an example of one slide actions on one of the buttons named CLEAR:

PHP Code:
panel.CLEAR.onRelease = function(){
yTargetMC = 325;

[code].....

View 2 Replies

ActionScript 3.0 :: Centre MC With Browser Zoom

Jul 6, 2011

I have been struggling with the affect the browser zoom level has on my application for days. Finally I built the below test swf and noticed that when user zoom in using the browser zoom (IE 8) the box centering stopped working correctly.Movie with moviclip named box and button named mybtn with three text fields:

[Code]...

View 1 Replies

ActionScript 2.0 :: Stage Centre Not Top Left?

Sep 13, 2010

i am struggling to work something out here and am hoping that someone on here can put me right...i have a flash movie that uses a liquid type layout (ie all from top left to fill the stage) - part of the movie is a navigation that when clicked slides around the stage to set positions. the problem is that the nav co-ordinates (points it travels to) are all based around top left of the stage, and i need to make it work from the centre of the stage.this is an example of one slide actions on one of the buttons named CLEAR:

PHP Code:
panel.CLEAR.onReleasefunction(){
yTargetMC 325;

[code]....

View 2 Replies







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