ActionScript 3.0 :: Question Regarding Startdrag() Bounds?

Nov 16, 2010

I am trying to make this an kinda interactive map in flash. I will try to explain it for better explanation. Here is an image of the output I have a jpg image(converted to movieclip) which is way larger than the stage.

[code]...

Then I have a mask in the center of the stage and user sees a portion of the map and is allowed to scroll to move mouse around to see areas around the focused city.

[code]...

I put this numbers in by playing around but where are these values exactly coming from. I have tried everything(every possible way) but cant figure out what are these values. I need to numbers to be dynamic so I can change the focus to different cities(for example when a user click A city A should be seen inside the mask and so on).How can I make these values dynamic instead of hard coding them.

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Using Bounds In StartDrag If RotationX Property Is Changed?

Sep 26, 2010

I've created a flash card class in ActionScript that uses a tween to flip the card over the y-axis (i.e., by using rotationX). I also use the bounds property of startDrag so that, when you drag it, its movement is locked on the x-axis. (There's also a method for switching between dragging and flipping, but since that's not broken, there's no need to discuss it further).

Here's my problem. If I haven't yet flipped the flash card over, the card drags fine. If I flip the card over and don't use bounds in startDrag, it works fine. But if the bounds property is set and then I try and drag the flash card after it's been flipped, the movement goes all haywire. It basically jumps back and forth between the two ends of the bounds' rectangle.

Is there any way you can think of to solve this problem? Alternatively, is there any way to use sprites to limit movement? For example, would it be possible to place a pair of one-pixel-thick horizontal lines on the top and bottom side of the flash card, set their alpha to zero, and somehow stop the flash card from moving past the lines?

View 4 Replies

ActionScript 3.0 :: Flash StartDrag Setting Negative Bounds?

Dec 17, 2010

I have a large movieclip (2336 x 1752) and a stage of 800 x 600. I want to be able to drag the movieclip around the stage so no white is visible:

minimum x before I get whitespace: -1536
minimum y before I get whitespace: -1152
maximum x before I get whitespace: 0
maximum y before I get whitespace: 0

I have tried this:

Code:
var mcBounds = new Rectangle(-1536, -1152, 0, 0);
mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
mc.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);

[code]...

But it doesn't drag at all...when I try it just moves it to it's maximum position and stays there.Is it because the rectangle can't have negative values?

View 2 Replies

Actionscript 3 :: Applying Rotation Of Sprite To StartDrag()'s Rectangle Bounds

Apr 13, 2010

from my main class i call to create a sprite and add it to the stage

private function addSwatch(evt:MouseEvent):void
{
if (stage.getObjectsUnderPoint(mousePoint()).length == 0)
{

[Code]....

View 1 Replies

ActionScript 3.0 :: StartDrag And Bounds - User Will Be Able To Drag The Image, As Long As The Edges Of The Image Doesn't Show?

Jan 19, 2011

I have an image on the stage which is bigger than the stage itself:

The stage is 700x550

The image is 2100x1650, and it's registration point is at its center, if I remember correctly.The initial location of the image on the stage is 350,75.I want to make sure that the user will be able to drag the image, as long as the edges of the image doesn't show.here's what I did:

mapRect = new Rectangle(0-mapMC.width/2, 0-mapMC.height/2, mapMC.width, mapMC.height);

and later on:

mapMC.startDrag(false,mapRect);

The the top and the left of the image are bounded well, but as far as the bottom and the right side of the image.

View 1 Replies

Flash :: Canvas Moved On StartDrag() Without Calling Set X / Y Or Move() - How Does StartDrag() Exactly Work In As3 / Flex

Feb 11, 2011

i have an .as class that extends mx.containers.Canvas (it's a draggable border of a resizable component), it becomes draggable on MOUSE_DOWN and stops being draggable on MOUSE_UP, MOUSE_OUT and ROLL_OUT. before calling startDrag() i create a Rectangle to define the drag area, i also have a _dragging: Boolean variable to control if it's draggable at the moment. the problem is that when i click this border it jumps to a negative coordinate without calling startDrag or switching _dragging to true.

i've overriden get x, set x, get y, set y and move() methods in order to solve it but the only thing i got was the fact that position changes without calling coords setters or move(), but at the moment it's changed a getter is called and returns new (negative) value so my question is what happens on startDrag() and how to filter unwanted incoming coords values?

View 3 Replies

Actionscript 3 :: Flash - StartDrag() Within StartDrag() On Child MovieClip

May 19, 2011

as you can see, I have a container MC which I have added to the stage. I set its drag constraints using a Rectangle(). I then add the 'cat' child movieclip to the container, and I want this to be dragable too. However, as soon as I click on my cat when testing the MC. It shoots to point x=0 y=0 on the stage and doesn't move.

The container MC can be moved without any trouble.

If I remove the rectangle bounds from the containers startdrag() function. both MC's can be dragged without any issue.

//panning ability
my_x = 800 - myImage.width;
my_y = 480 - myImage.height;

[Code]....

View 3 Replies

IDE :: SWF That Draws Outside Its Bounds?

Mar 3, 2009

I opened up the NY Times homepage, and they have this giant Apple addvertisement that has animations over the entire top half of the page, outside the area occupied by the swf.

View 1 Replies

ActionScript 2.0 :: Mask Mc Going Out Of Bounds

Nov 10, 2011

Although I put _x = player._x etc. code in an onEnterFrame function the masking mc is moving without the player

You see...the player is held within some borders. When cornered and then hit, the mask moves according to how it would move normally, but without the player (because he is held in place by some borders)...

Also, if I don't have a problem but I'm missing a crucial piece of code,

code on masking mc

ActionScript Code:
stop();
this._x = _root.player._x;
this._y = _root.player._y;
radiance = 180 / Math.PI;

[Code]...

View 1 Replies

ActionScript 2.0 :: Tell If Something Is Within The Stage Bounds?

Jun 23, 2009

I have a bunch of images going on all at once, some on the stage, and some off, and i would like to find a way of telling whether or not they are currently on the stage or not....

I know i can do the whole

checkStage = function () {
if ((mc._x>=0) && (mc._x<=Stage.width) && (mc._y >= 0)&&(mc._y >=Stage.height)) {
//have mc do whatever here

[Code].....

that way i can satisfy my laziness AND achieve what i'm trying to do without having to deal with long winded paths and a bunch of else if's

View 1 Replies

Flex :: Setting Bounds For WindowedApplication

Jul 9, 2010

for some reason this flex 4 code gives me an error but I can't figure out why. In my WindowedApplication I have:[code]That seems like a bogus error since I can assign pref.bounds to rect without an error. I don't know why this isn't working. It works under flex 3 compatibility mode but that also breaks a lot of my spark components so I can't use it.

View 1 Replies

ActionScript 3.0 :: Random Motion Within Bounds

Mar 12, 2008

I have a script that produces random motion along the y axis, however, I want that motion to occur within the movie clip that is centered on the stage, or I should say within the bounds of that movie clip.
The movie clip has a height of 335 px

[Code]....

View 9 Replies

ActionScript 3.0 :: Monitor Whether An Mc Is Inside Bounds Of Another?

Jul 31, 2009

I am wondering if there is an easy way of monitoring whether or not an mc is within the boundaries of another mc while it is being dragged. Currently I am using different equations to determine the leftmost, rightmost, topmost and bottommost points of each mc and then when they are being dragged comparing their x,y coordinates. Is there an easier way... I ask because this seems to be quite a lot of code to get through for such a simple operation, especially when the function containing the code is being called each time the mouse moves..

View 1 Replies

Flash 10 :: Out Of Bounds Expandable Banner?

Dec 30, 2010

How is this kind of expandable banner done? [URL]

View 0 Replies

ActionScript 3.0 :: Index Out Of Bounds Error

Oct 8, 2011

I"m getting this error with these two bits of AS3:

ActionScript Code:
public function tmFlashPlay():void  { //Play TubMates Flash
tmClip.y = 0;
galleryMask.y = 0;

[Code]....

If I'm reading it right it is saying that the index supplied for the child is out of bounds. Yet it is the index captured earler, and I add or remove no children in between these functions being called.

View 4 Replies

Actionscript 3.0 :: Get Bounds Of A Rectangle On Stage

Apr 30, 2009

I have a simple MC on the stage. I want to create a simple conditional statement that would check if the mouse is on the rectangle using get bounds. something like [code]Basicaly...how do I properly use the getBounds in a situation like this?

View 3 Replies

ActionScript 3.0 :: Saving BitmapData Withing Bounds?

Feb 15, 2009

So I am trying to save a screenshot using JPGEncoder while in full screen mode. The document size is 100x700, and the stage is aligned to bottom. I've been able to capture the right size, however it always seems to capturing the image from the wrong start x,y position. There is some elements out of bound but I am just trying to clip them.

Here was last attempt :

Code:
stage.quality=StageQuality.HIGH;
stage.align=StageAlign.BOTTOM;
StageScaleMode.NO_SCALE;

[Code]....

View 2 Replies

ActionScript 3.0 :: Dynamically Calculating Bounds Of A Rectangle?

Dec 15, 2010

I am creating an app that has to load a image or swf on to the stage and dynamically place and position it on either sides of the stage i.e. (top, left, bottom or right).how can I dynamically calculate the remaining bounds of the stage using the bounds of the dynamically placed loaded image/swf. ?e.g if the bounds of the loaded clip isRectangle(x=10, y=10, w=250, h=800);What is the remaining Rectangle() to use ofRectangle(0,0,1024,800); ?

e.g if the bounds of the loaded clip is
Rectangle(x=0, y=0, w=800, h=50);
What is the remaining Rectangle() to use of

[code].....

View 3 Replies

Actionscript 3 :: One Get The Stroked Bounds Of A Symbol In JSFL?

Nov 8, 2011

DisplayObject.getBounds in actionscript returns the bounds of the object with the strokes included. The left, top, width, height properties of a SymbolInstance in JSFL don't seem to include the strokes. That's the only way I've found to get the bounds of a symbol from JSFL.

View 2 Replies

Actionscript 3 :: Flash Supplied Index Is Out Of Bounds?

Dec 1, 2011

I'm trying to remove children from a movie clip upon user interaction but it's saying "the supplied index is out of bounds" - however, I must be missing something because it doesn't seem like anything is out of bounds. This is my code:

Circle.as:
for (var i=0; i<3;i++){ //this number should be based on the number of children found in the XML

[code].....

View 2 Replies

Actionscript 3 :: GetLatLngBounds Returns Weird Bounds

Feb 29, 2012

I'm working with the Flash Api for Google Maps in my Actionscript/Air project. I now need the latLngBounds (the top left, top right, bottom right and bottom left) values of the current view of the map. The function map.getLatLngBounds should do that, but it always gives me a really low lat/lng bounds back. Always somewhere around:

[Code]...

View 1 Replies

ActionScript 3.0 :: Scrollbar Bounds Not Working Correctly?

Dec 3, 2009

so I tried getting this custom scrollbar to work, but the bounds must be screwed up.Whenever I click on the scroller, it shoots halfway down the screen...it then thinks that the middle of the screen is the top bound and the bottom of the screen is the lower bound

ActionScript Code:
// Scroll My Content function - AS3
function scrollMyContent () {

[code]....

View 0 Replies

ActionScript 3.0 :: Free Transform Manager With Bounds?

Nov 15, 2010

I use this transform managerblog.ryantan.net/2010/08/free-transform-manager/I'm trying to add bounds support.But it doesn't work fine:ki44321.ho.ua/testmanager/Here is source (FlashDevelop project):ki44321.ho.ua/testmanager/source.rar

View 0 Replies

ActionScript 3.0 :: RangeError - Supplied Index Is Out Of Bounds

Dec 6, 2010

When I Write this code
ActionScript Code:
setChildIndex(loading_info,MovieClip(root).mcContent.numChildren+1);

I found this output
RangeError: Error #2006: The supplied index is out of bounds.
at flash.display:isplayObjectContainer/setChildIndex()
at Dan_fla::mcContent_1/on_pic_loaded()

View 3 Replies

Actionscript 3.0 :: Drag Glitch When Mouse Goes Out Of Bounds?

Feb 6, 2009

It happens when you drag the scroll slider out of bounds and you release - even when mouse is up the slider still moves. I consider it a glitch. What does somebody has to do to fix it?the code I use for the slider:

Code: Select allscroll_btn.buttonMode = true;
var dragging:Boolean = false;
var bounds:Rectangle = new Rectangle(-10,-13,0,138);

[code].....

View 4 Replies

ActionScript 2.0 :: Proportionate Resize Based On Bounds?

Jun 24, 2005

i have a container that is 100 x 100 and i have various symbols of different shapes and sizes (states for a U.S. map) that i am loading into that box and need to resizesome are bigger, some are smallerow to scale them proportionately larger or smaller depending on their size relative to the container.here's what i have so far

Code:
attachMovie(_root.curState, "curState", 100, {_x:25, _y:15});
widthBound = 100;

[code].....

View 3 Replies

ActionScript 3.0 :: Scrollpane - The Supplied Index Is Out Of Bounds

Dec 17, 2009

I'm adding a bunch of movieclips to a container clip. I then add that to the scrollpane. When I run scrollpane.update() it gives me the error "The supplied index is out of bounds". From the full error message it looks like it's happening on the DisplayObjectContainer/getChildAt() which is run in the update() method. I thought I had it going once but now it's not again and I can't figure out what I was doing differently.

View 1 Replies

ActionScript 3.0 :: Stop Mask Being Dragged Outside The Bounds Of The Image?

May 13, 2010

I wish to stop my mask being dragged outside the bounds of the image. The current set up I have is as follows. I created a circle and added a blur; I then exported it for action script setting its class as a sprite with the class name "Circle". I also made my image i was going to mask a Movie clip with the isntance name "mc_bee". In the actionscript I added it to the stage, positioned it and cached it. I tried to add in actioscript to create the bounds the image the mask is making with the code below:

[Code]...

View 1 Replies

ActionScript 3.0 :: Error #2006: The Supplied Index Is Out Of Bounds

Jul 26, 2009

i'm trying to addChild with an interval, using this piece of code, but I allways get an error saiyng the suplied index is out of bounds.what should I do to have mc1 added then wait lets say a second and add m2 2 and so on?
 
var tempo_espera:Timer = new Timer(1000, 1);            tempo_espera.addEventListener("timer", inserir);            tempo_espera.start();            //            function inserir(evt:TimerEvent):void {                for (var nv1:int = 0; nv1<promocoes.length; nv1++) {           

[code]....

View 13 Replies

Actionscript :: ABC Data Is Corrupt / Attempt To Read Out Of Bounds

Mar 3, 2010

Getting a VerifyError using the TweenMax lib when calling TweenMax.to. This error doesn't seem to be specific to TweenMax (we've found other people having errors with unrelated code). Perhaps someone has some insight into what this error means and what could be causing it.[code]

View 1 Replies







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