ActionScript 2.0 :: [Flash8] StartDrag Jumps To The Top Left Of The Stage
Aug 2, 2006
I am having problems with creating a vertical slider using startDrag. For some reason, when the dragging starts, it jumps to the top left of the stage...
View 11 Replies
Similar Posts:
Jan 13, 2012
have a thing where i have a million drageable objects and to make it easy i made each one of them a movieclip with this on
on (press) {
startDrag ("");
}
[code].....
View 1 Replies
Apr 10, 2009
i have made a sniper style game an hav programme a moment where there is pause between each click (reload time) but how do i make it so that when the gun is reloading the left click is disabled, as it stands now while the gun is reloading the aim doesnt move but if u click on an enemy they still die as it stil sees it as clicking on it, how do i disable it for these 2 seconds while my gun reloads
View 1 Replies
Apr 26, 2007
resizing movieclip using action script. I doing a resize on the width of the moviclip. What i got is the movieclip resize on center, but i want is on left. the code i use as below:
MovieClip.prototype.resizeMe = function(w) {
var speed = 3;
this.onEnterFrame = function() {[code]......
View 2 Replies
Jan 18, 2011
I would like to start drag objects which is located in stage.There is movie clips in the stage which also encloses so many objects.when i click on any of the object it should be startdraged..Do u have any solution?
addEventListener(MouseEvent.MOUSE_UP, targetMC);
function targetMC(MouseEvent:Event):void
{
[code].....
View 3 Replies
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
Dec 10, 2009
I have created an animation (see attached) where the stage can be dragged from left to right to reveal hidden areas off the edge of the stage. Unfortunately I need to add buttons containing links to websites within the dragable movie symbol and I can't work out how to do it.
View 2 Replies
Oct 5, 2011
startDrag(); seems to stop dragging once the mouse leaves the stage. Is there a way to set it to still drag when off the stage. The exhaustive search I've tried only says things about capture the event for the mouse leaving the stage, not continue any dragging or animation, etc. In more detail, I have a "flashlight" type sprite that covers everything with black, and allows the user to see a small circle of stage. The center of the circle is where the mouse is. When the mouse goes over the edge, half of the circle (or more depending on how fast the mouse moved) is still visible. I need it to at least move off stage completely.
View 3 Replies
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
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
Jul 14, 2010
Is there a way to see if the mouse has left the stage in as2? I need to call a function but only when the user rolls out of the movie.
View 8 Replies
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
Apr 29, 2007
I want flash banner to span acros the screen so I put width="100%" and Stage.scaleMode = "noScale"; ok. But, this way all its content is centered. I want it to stick on the left, and so I put this code in it:
Code:
onEnterFrame = function () {
_root._x = 0.5 * (750 /* original document width */ - Stage.width);
}
This works. But the way this thing works when I resize browser window is far, very far from smooth. I tried to change it to
Code:
onEnterFrame = function () {
var rx = 0.5 * (750 - Stage.width);
_root._x = rx + 0.1 /* or another number */ * (_root._x - rx);
}
I am wondering if there is some straightforward way to do this, like some hidden FLA setting, or some Stage/_root property, and if there is no, how the hell to script it?
View 1 Replies
Oct 27, 2010
i am trying to check if the movieclip has left the stage. by using the Stage.width. When the movieclip leves the stage no it not recognised. As the trace function does not appear.
var stageName = Stage.width;
var speed:Number = 5;
box.onEnterFrame = function(){
[code].....
View 7 Replies
Apr 21, 2011
I am making a platformer in actionscript 2 for a school project and I've run into trouble.
I'm using a big (5755px or something, if I recall correctly) bitmap as a background for my game so I need the camera to center on the main character movie clip which is situated in the beginning of the stage (and bitmap).
So, in order to use the full canvas I need to center the camera at the far left of the canvas.
This would be something essential for me to be able to use the entire canvas but I couldn't find anything on the internet about it .
View 5 Replies
May 20, 2009
I'm creationg a full screen projector presentation and i'm havin issues with the stage align on full screen. it opens in the middle of the stage and is chopping off the top of the large stage. does anyone know the as2 for Stage.align="T"; ?
View 1 Replies
Sep 22, 2009
What I'm trying to do build an FLV player which will take the size of the FLV movie and dynamically adjust the stage width/height to match the FLV.
View 2 Replies
Oct 10, 2009
I have spent the last 2 weeks searching the web for a tutorial on content scrolling. I have a movieclip/graphic that I want to scroll from left to right on the stage. Example of what I am trying to do: [URL] but without the vertical scroll. There seems to be a couple of AS2 tutorials around I doing it in AS3.
View 2 Replies
Oct 17, 2008
I know we can track when the mouse has left the stage area in AS3.
But, can it reset a button that would have stayed in its "on" state?
My swf will be embedded in a web page, there are 24 buttons all around its border, and as soon as the mouse leaves the stage, they stay "on", so I want to reset them to the initial state.
View 1 Replies
Jul 26, 2011
I'm a bit newbie to Flash, and I'm experiencing strange problem. I have a simple flash application, which when run in Flash player looks like this
the thing is, when i resize the Flash player window, a black frame becomes visible to the left and top of the stage. is it possible that these black areas start appearing on the right side, and the stage to be fixed on the left? The strange thing is that these black areas are not part of the stage, the (0,0) coordinate is there where white area starts and not in the corner of the window, and that's causing me problems.
View 1 Replies
Aug 27, 2006
I'm sure that many of you already saw things like this ( eg: when winning at FWA S.O.T.D., you get a little "logo" and many sites have it aligned in the upper left corner), so this is what i want to do, let us say i make a MovieClip ( dimensions doesn't matter, but it's quite small ), and i want to align it to the upper left corner of the stage... The thing is that the movie/stage is set to auto-scale, so whenever i scale the browser window then that MC should "refresh" its position and stai at the upper left corner again.
View 3 Replies
Mar 19, 2009
I cannot find any information anywhere on how to change my layout or even the ruler layout in Flash. The stage is stuck in the upper left-hand corner of the pasteboard. If I could get the zero point of the rulers to move (like to the right and down), then I could reposition the stage, but I can't. There is no edit ruler function. The zero points are right in the upper left-hand corner together.I can't see items which I need positioned to the left or above the stage at all. Does anyone know how to change the stage position on the pasteboard or ruler layout?
View 6 Replies
Dec 25, 2011
I've a movie clip in the stage that moves from left to right.
And i whant to add more instances from that movie clip
I tried:
Code:
addChild(cloud);
stage.addchild(cloud);
View 3 Replies
Jul 5, 2010
I am trying to add x amount of movieclips to the stage with their own unique _x value. Also with each movie clip added i need to add an array with a smiler name. I tried this code.
Actionscript Code:
enemycount = 46;for (i=1; i<enemycount+1; i++) { this["currentenemy"+(i)]=_level0.enemydatabase[0]; this.attachMovie("BrownFox", ["enemy"+i], 101, {_x:100, _y:219});}for (i=enemycount; i<51; i++) { this["currentenemy"+(i)]=_level0.enemydatabase[1];}trace (this.enemy1._x);trace (this.currentenemy45);
under the attachmovie I have ["enemy"+1] but when i trace enemy1 it returns undefined. But when I put ["enemy"+1] it returns the _x value. also if I put _x: i * 5, I only see one movie clip so I have a feeling they all have the same _x and_y value. basically I wanna be able to add 2 enemys to the stage with out over lapping, and the option to add 50 with out too much over lapping (would like to avoid overlapping by also giving various y depths, between 200 and 250)
View 10 Replies
Oct 11, 2010
I m using textarea. The problem is when i try to select a text and go out of stage and leave the mouse then again move mouse on text then selection of text will move with the mouse.
Here is what causes that:click somewhere on the text and drag the mouse in order to select the text then go out of the swf leave the mouse now move mouse on textarea -> the selection of text will move with the mouse...
How to stop this behavior?I tried to implement mouseleave on stage but the problem is i m not able to detect mouseleave event when mouse is pressed and it leaves the stage.
View 3 Replies
Apr 19, 2011
In my adobe Flash CS5 when i create a new symbol it opens in a new screen as normal. the stage that I can edit it on however is stuck in the top left when I zoom out and it's starting to drive me nuts. I can't work with it like that.
View 5 Replies
Apr 6, 2011
I'm trying to get my clip to stay at the left of the screen on stage resize, but it isn't working. This is my code:
stage.addEventListener(Event.RESIZE, resizeHandler);
function resizeHandler(e:Event){
circleMenu.x = 0;
}
Obviously that doesn't work, but how do you get the global zero X position. When I resize the window, my clip moves along with it.
View 2 Replies
Jan 11, 2011
I load my movie with loadmovie and when the swf plays on the frame, the whole website shifts to the left. My code is very simple
stop();
myMC.loadMovie("youtubeplayer.swf");
myMC2.loadMovie("hyper_youtube_version.swf");[code].....
When I load the myMC2.loadmovie Hyper_youtube_version.swf, the whole website shifts to the left. Plays fine but I cant figure out why its doing that. When I load a regular player....it works but but the new player I got hyper_youtube_version.swf is loaded, it doesnt seem to work.
View 0 Replies
Dec 7, 2004
I have the following script in both frame 1 and 2 to let a movieclip move from right to left on the stage:
[Code]...
And the clip is indeed moving from right to left on the stage and when it reaches _x -550 it is going back to it's starting position _x 250 only the movement isn't smooth at all. What should I do to make the movement more smooth or should I use a completely different script?
View 6 Replies
Sep 22, 2009
I am moving movieclips around my stage in relation to the users mouse location. All of my movieclips have the registration point placed in the default top left corner. As an object moves off the stage to the left it suddenly disappears when the registration point reaches the edge of the stage. I would like to see the whole object move off the screen instead of just disappearing when the left corner reaches the edge. I would move the registration point to the right side but I would like the movieclip to be able to move off all sides of the stage (top, bottom, left, right)
View 5 Replies