ActionScript 3.0 :: StartDrag On Object Inside 3D Rotated Container?
Jan 7, 2010
Here's the layout:I have a main SWF. Inside that main SWF is a container MC that has been rotated in 3D space to have a bit of perspective. Inside _that_ container is a container MC into which is loaded various images, videos, and SWFs. Images: no problem. Videos: no problem.The problem:If an SWF is loaded into the media MC that has an MC in it with a listener/startDrag combination allowing that MC to be dragged it seems to fail (the drag).I've tested this child SWF extensively to make sure the drag works, and I've even loaded it externally into other SWFs and it works. I've also tested in various ways to make sure that the problem isn't something simple, like an intervening clip in my main SWF keeping the MouseEvent from reaching the MC with the startDrag
View 1 Replies
Similar Posts:
Feb 6, 2011
I have the following display hierarchy:- - container- - - objectI need to draw 'object' to a BitmapData instance which matches object.getBounds(stage) rectangle area. So the first part is easy:
ActionScript Code:
var rect:Rectangle = object.getBounds(stage);
var bmp:BitmapData = new BitmapData(rect.width, rect.height, true, 0x00000000);
[code]......
View 2 Replies
Feb 17, 2010
I have this enter_frame listener to make my Container MovieClip rotate on a 3D environment in relation to the position of the mouse.
PHP Code:
addEventListener( Event.ENTER_FRAME, loop );
private function loop( e:Event ):void
{
var distx:Number = mouseX / stage.stageWidth;
[Code]....
One of the MovieClips I load into that "ctt" container has some scrollable content. I've traced both the CLICK and MOUSE_DOWN events on the Dragger of the scrollbar and it's active, it receives the click and mouse_down events. The problem is that it doesn't drag.
I know that the scrollbar works because if I remove the loop enter_frame event I showed before it works perfectly, it just doesn't rotate on a 3D environment as I wanted it to.
why the dragger doesn't drag when that ENTER_FRAME event like that is being used?
View 2 Replies
Apr 12, 2012
I am developing a paint board application using flash builder. User can draw some shapes objects(ellipse, circle, rectangle). I want to implement grouping/un grouping feature some like ms-word in my application. I group multiple objects by putting them inside a container(UIComponent). Now i apply resizing to container and it resize well. I am using a free object handler API to apply selection handle over the container. I want to resize and reposition all children with respect to container changed size. Every thing goes well until all children inside container are having rotation = 0. But if there is any child which is having rotation >0 and <0 things goes worse. The child resize but not in a proper manner. I stretch the parent container width and it increase the height of rotated child. Is there any way using Matrix class or something else to transform all children in same direction and same ratio respective to container?
View 1 Replies
Apr 5, 2011
My basic requirement is to draw a circle inside a BorderContainer with the layout set to BasicLayout.I run this method in the CREATION_COMPLETE event of the BorderContainer object.[code]I know I must be missing something VERY basic here. Can I just draw like this OR should I draw in some other event? I know that I can create a Ellipse object and easily add it to the border container but I would like to know how I can do this using the graphics object.
View 3 Replies
Jun 5, 2011
I have a Movieclip (MC1) with and moving object (OBJ1) inside it and using AS3. I want to do a hit test on it with another object (OBJ2) that is on the stage. Normally I would just do MC1.x + OBJ1.x to get my coords for the hit test. But how do I do it if MC1 has been rotated?
View 2 Replies
Oct 12, 2009
i need to check if a point is within a rotated rectangle. I have to do this mathematically, as none of the objects are on the stage so i can't use hitTestPoint. I know the position and rotation of the rectangle, and if necessary can get the four corners as points as well.
I kind of feel silly asking this, because i am pretty sure it's not a hard thing to do, i just can't work it out and so far any google searches just bring up hitTestPoint.
View 14 Replies
Jan 27, 2010
I'm currently working on a custom component which extends Canvas (let's call it SuperCanvas) ; it's basically a container that let you zoom & pan its contents. It would be too long to explain why, but I can't use scrollRect, so I was forced to declare a Canvas object (called innerCanvas)... inside my SuperCanvas (I know, not very nice =/) I would like to know if there's a proper way to "redirect" the creation of my component's children in this canvas.
[Code]...
View 1 Replies
Oct 7, 2011
I am currently making a game based on slicing other objects, basiclly when you hold down and drag your mouse and then release it an object that shows the cut will be created.
//Sliceline.as
package
{
import flash.display.Bitmap;
[code]....
View 1 Replies
Jan 31, 2010
If I create a rectangle with 100px width and 100px height and then rotate it, the size of the element's "box" will have increased.With 45 rotation, the size becomes about 143x143 (from 100x100).Doing sometimes like cos(angleRad) * currentWidth seems to work for 45 rotation, but for other bigger angles it doesn't.At the moment I am doing this:
var currentRotation = object.rotation;
object.rotation = 0;
var normalizedWidth = object.width;
[code].....
View 4 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
Oct 17, 2009
I've on box named=box1, and added action script.[code]I want to make duplicates of box1 and script should be the same as above.[code]But when i click on button again, box1 duplicate is disappearing. I do not want that.
View 5 Replies
Aug 9, 2005
I am trying to resize an object inside a movie clip. In inside this movie clip there is two objects. One object is the main one that I want to resize while draging the other. The problem is that when I am calling the drag object it does not respond.
View 1 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
Jun 9, 2009
I'm trying to place the 3d photo wall inside a container mc to enable a full-screen scroller also. I get the repeated error "1120: Access of undefined property con.
View 1 Replies
Sep 21, 2011
I'm creating a master movie that will load 4 external swf's. To do this, I made a container of sorts by having an animated screen rising up. I created an empty movie clip and titled it "empty_mc". I dragged it onto the "container screen" but when I press any specific button to load one of the external swf's, they don't maintain the container size.
So, how do I ensure when a button is pressed for a particular swf, that it stays within the confines of the container? To see what I'm trying to do, here is the site: [URL]
Some of the buttons aren't working yet. However, the Drag and Drop one does for sure...just out of scale of the container.
I'm experimenting with how to do this by this code by using loadMovie and loadMovieNum. I believe I'm supposed to use loadMovie if I want it to be inside a container. I know the code is messed up in parts, but I was just trying to see which one gave me the best result...none did what I wanted it to do,
[Code].....
View 2 Replies
Mar 23, 2012
I have a main swf container, who loads external swf . All my files are connected a php files who are connected one database in one server. Sometimes when I load my project the external files they take a long time to load.
View 2 Replies
Nov 6, 2009
I am trying to target items inside a movieClip container. The container is called holder.
Inside holder I have a bunch of items such as other movieClips and TextFields.
How do I target, for example the TextField inside the holder clip??
Fore Example, I tried this, but doest work...
holder.textField.x = 100;
View 6 Replies
May 26, 2010
I've created several frames, and buttons inside them. With the click on a button inside a frame, I need to highlight the frame.how to access the whole movie clip with the click on a button that is a part of it (what keyword, syntax etc) . The button is a part of the frame (same movie clip) and this has to be done with the help of this button (not by adding an event listener on the whole movie clip);
View 0 Replies
Sep 22, 2011
I'm creating a master movie that will load 4 external swf's. To do this, I made a container of sorts by having an animated screen that rises up. I created an empty movie clip and titled it empty_mc. I dragged it onto the "container screen" which I named movieScreenbut when I press any specific button to load one of the external swf's, they don't maintain the container size, they appear full screen on top of my master movie screen.So, how do I ensure when a button is pressed for a particular swf, that it stays within the confines of the container? To see what I'm trying to do, here is the site:URL...Some of the buttons aren't working yet. However, the Drag and Drop one does for sure...just way out of scale of the container.
I'm just experimenting with how to do this by this code by using loadMovie and loadMovieNum until someone helps me understand what I have to do. I believe I'm supposed to use loadMovie if I want it to be inside a container.[code]
View 0 Replies
Oct 13, 2009
how I can use SWFobject to place a SWF inside a container?
I am using SWFobject to make the width and height 100% so that it takes the entire browser screen. However, I want my swf to stay within a horizontal border (so that it takes up say 100% height and 90% width). But, even if I place the flashcontent div (that I target with SWFobject) within another container div (which I only target with CSS, with 90% width and center it). The SWF file will take up the whole page, going over the margins of the container div.
View 2 Replies
May 26, 2010
I've created several frames, and buttons inside them. With the click on a button inside a frame, I need to highlight the frame. Could someone please tell me how to access the whole movie clip with the click on a button that is a part of it (what keyword, syntax etc) . The button is a part of the frame (same movie clip) and this has to be done with the help of this button (not by adding an event listener on the whole movie clip);
View 1 Replies
Jun 4, 2011
I've added a sprite container like this:
Code:
var container:Sprite = new Sprite;
addChild(container);
[code].....
View 2 Replies
Oct 13, 2009
Has anyone successfully used hitTestObject on objects that weren't on the stage?
I have game code that works fine when the objects on are the stage, but replace "stage" with "this" (the game object that covers the whole stage) and it doesn't work.
View 0 Replies
Jan 15, 2010
What's the best way to scale a container mc but not scale the children inside it? Basically I have a box mc with a background colour, with a logo added using addChild, if the user changes the browser size the box scales to the height of the window but it's also scaling the logo, I just want to change the height of the container box really.
View 4 Replies
Dec 27, 2010
I have an AS2 .fla with all of my stage items on the timeline as opposed to inside a container swf. I must chose Center vertical and Horizontal options in the HTML alignment options when publishing in order for my movie to be perfectly centered in the middle of the browser. I would like to have a FULL Browser Background Image, however when I try using the following code, my background ("bg") does not fill the entire browser.
what I am doing wrong and if it is even possible to have a full browser background image while still using CENTER alignment in the HTML publish settings? I have tried the following code with and without the Stage align settings and with the xy coordinates centered-still no luck!
bg.Stage.align = "TL";
Stage.scaleMode = "noScale";
bg._width =Stage.width;
bg._height =stage.stageHeight;
bg.x = 0;
bg.y = 0;
View 30 Replies
Jun 25, 2009
I have an AS2 .swf being loaded as a child of a parent AS3 .swf. The AS2.swf calls loadmovie() and unloadmovie() to display 3 jpeg files. The images load the first time, but after that, a call to loadmovie() to replace the image, or a call to unloadmovie() fail. I found the following Adobe Bug report ([URL]) that has said this has been resolved, and also said that child movieclips could be replaced without a problem. Here is the code I'm calling.
[Code]....
View 2 Replies
Oct 26, 2011
I have a 3 mc's into a container and I want to add a MOUSE_OVER or CLICK event listener for each mc inside the container ("for" Loop)..
the code:
ActionScript Code:
var container:Sprite = new Sprite();
container.x = stage.stageWidth * 0.5;
[code]....
View 4 Replies
Jan 21, 2010
I'm looking for the best way to get a flex 4 image object to resize and horizontally center whenever its parent container (a custom component based on group) resizes. I cannot set horizontalCenter="0" to accomplish the image centering because I use a move transition to "slide" the image in and out of view.
I'm externally setting the image source in the component. Here is a simplified example of my component code that only addresses resizing the image.
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" >
[Code].....
View 2 Replies
Oct 29, 2009
How can i draw sound spectrum inside a display container other than stage?I tried to display it inside the rectangle movieclip but end up in failure.[code]...
View 2 Replies