ActionScript 3.0 :: Make Reference Back To The Object Container?
Nov 23, 2009Is there a way to reference the object and its other property base on the position of the target
[Code]...
Is there a way to reference the object and its other property base on the position of the target
[Code]...
So i am building a portfolio and have my main stage with three frames, the first is my navigation section with 2 buttons button 1 sends the playhead to frame2 and button sends the playhead to frame3 etc here is the code
[Code]...
for (var k:int = 0; k < 1; k++)
{
money = new Money;
[code].....
I have a project (see attached) where I need to have the folders seem like they are floating in space, and I need the best way to make it so when you click on a back folder, it slides off the screen and come back in front of all the folders.
View 2 Repliesi want to know how we can make back button in flash to go back to page same like browser back button.
View 1 RepliesI'm working with a web service and am returning an array to a field (that I set the data type as an Array). The result thus far is "[object Object]". How can I get the array values back out as a string?
View 0 RepliesSo I have two circles and a square on stage, myCircle1, myCircle2, and mySquare. You can drag the two circles, if you drop either one outside the square it'll snap back to where it originally was, if it's touching the box it'll snap to the center of the square.
I want it so when the second circle (either one) snaps to the center of the square, the first one will go back to it's original co-ordinates. So only one circle can be in the square at any time.
I've attached my as file with the current code.
I have one MXML File as
<objecthandles:ObjectHandles xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" backgroundAlpha="1" xmlns:mx="library://ns.adobe.com/flex/mx"
[code].....
I have a movieclip that is loaded into a container movieclip. When I click on it, I want it to goto a particular frame and play. Have tried using the name of the container MC (LiftPlaceHolder.gotoAndPlay(10)) but this has no effect at all.
View 1 RepliesIs there a simple way to completely empty a display object container regardless of what it contains, including if it's already empty? In other words, without determining its children and using removeChild on each?
View 2 RepliesIm trying to make a container in flash but i would like the width of the container to be the size of the stageWidth & height to equal a set number. Having these set width & height will allow me to add another container right next to the side of the first container, this second container not being visible on stage. e.g. container1.x = 0, container1.width = 100, container2.x = 100.
[Code]...
as you can see the width has been set according to the object inside the container (the ball diameter 100, therefor container width not set to 100 rather than 550) If there is nothing to stop flash doing this, I had a thought of maybe adding a rectangle inside the container with no fill so its not visble therefore the bounding area is taken from that rectangle which could be set to a width of stage.stageWidth.
I have problem with accessing object created by function imported from another package.
I have 2 packages DragDrop and UserInterface. In UserInterface I create methods for buttons and later add them in DragDrop . I make it in two different ways:
One(this one works):
[Code]....
I am trying to get an image object from one sprite container and adding it to another sprite container. But when I use GetChildAt for this, it will remove the object from the parent sprite and place it inside the other.
Code: sprContainer1.addChildAt(sprContainer2.getChildAt( 1),0);
Problem is when I run this code sprContainer2.numChildren is getting reduced by 1, which seems that this code removes a child from sprcontainer2.
For some reason below is not working. It is probably very obvious but I am not seeing it. As soon as I comment out the container mc variable and just add Child to root timeline I see everything which means me container is not being added to the stage correctly.
stop();
import flash.display.MovieClip;
var i:int = 0;
var a:Number = 10;
var ageString:String;
var ageText:Array = new Array();
[Code] .....
I can't come up with a function that will collect the names of the children in a object container and put them in a array.
View 4 RepliesI am making button pieces for use in my GUI factory. I am having an issue placing my Thumbnail graphic w/Mask and border. The mask is not moving away from 0,0 when the Thumbnail is moved to 280,10.I can force it to 280,10. I will be multiples of this and other button in a scrolling menu with it own mask in a container.I am trying to build in a work-a-round for this feature.Here's the primary part of Thumbnail class:
public function Thumbnail() {// constructor code makeThumbnail();cHolder.mask = picMask;[code].......
I am doing some pre-production on a project that requires drawing on a 3d canvas, which I think flash is the best way to go. But there is a chance down the line that this client might want the site to show up on the ipad, iphone or other mobile devices that don't support flash.
So I was playing with the idea of doing everything in html and javascript except for the actual drawing/3D area. Almost like using flash as the element. I think html5 is too premature to start using this, but might be beneficial down the line. Chances are I will just go the entire flash route, but I thought it would be interesting to try. question is pretty top level. 1) how hard would it be to drag an object from an html page using javascript, and dropping it into the flashplayer. And then manipulating it from there.
Are there any examples out there that have tried to do this?
How do I remove all children from a display object container? I want to make sure that when I re-enter a particular frame that there are no imageLoaders loaded into my photoGallery.
View 2 RepliesHere'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 Replieslets say i have 2 classes in the same package.and i add the same event listener to each of them, for example i add event.resize to some display object container in both of them.how can i prevent the code attached to that listener to execute in one of the classes if that event happens?
View 2 RepliesBasically I've got a class called Controller and another class called:"EnemyShip".In EnemyShip's step() event (the ENTER_FRAME event), I call myStage.removeChild(this);[code]myStage is a reference in the constructor of the EnemyShip.as class
View 2 RepliesI 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]......
I have a created a sound object like so:
//Creating the Sound Object
sliderSound = new Sound();
[Code].....
It works great when viewed. the problem is that when I load this SWF file into an container SWF file (using loadMovie) the sound will not play.
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].....
ok so when I load a clip to a container it should overwrite that movieclip in favor of the new one. I've been going over the path tuts on various sites as well as variables (not sure if that would be better) so I'm still using _root instead of _global.Could the problem be putting more containers inside the main container on the main stage? I have to position things in different areas so that's why i have several containers._root.container1.container2.loadMovie("mav101.swf")[valie68 wrote]I'm have buttons that load one movie clip that controls another movieclip to load into a container on the main stage. they load but they wont overwrite each other. so they all wind up on the stage area together. maybe a paths problem?
View 7 RepliesI have a video object that dynamically changes. I want to put that inside of a movieclip that is always 320,240 no matter what the video object size is. I want the video object to increase or decrease but I always want to display it at 320,240. How would I write this? I tried:
ActionScript Code:
videoDisplay = new Sprite();
videoDisplay.graphics.beginFill(0xCCFF00,100);
videoDisplay.graphics.drawRect(0, 0, 320, 240);
[Code].....
But the video object still is large (my video object is 480,360 in this case). It seems like it is not nested inside of the the videoDisplay sprite which should only be 320,240.
i need help about how to create an object container that contain TextField,movie clip, etc
[Code]...
I am going to have a situation where i have all sorts of different sizes of graphical data coming at me from XML. The only thing that all of these assets have in common is that they will be sharing a 100px by 100px thumbnail and they are SWFs.My question is, how can i make an object fit into the thumbnail so that:1) Theres no cropping of the item2) Items smaller than 100x100 must be enlarged3) Items larger than 100x100 must be shrunk
View 7 RepliesHow to make a container/Movie Clip dynamically resize such as the effect employed in this site (animations included): [URL]. Furthermore, is it possible to have images load from an XML file and contain the information needed to have the container/Movie Clip resize accordingly.
View 1 RepliesThis has to be simple, if only I knew how. I'm an AS3 newbie, and am having difficulty setting up multiple specific EventListeners within a code generated display object container.
I am generating a 'page' (Sprite) with a heap of 'cards' (Sprites) on it. Each of those cards, in turn, contains a selection of text boxes and other objects generated from database output using a 'for' loop. My hope is to attach an EventListener to each 'card' so that a MouseEvent will let me manipulate the data that lead to the content of that actual card (the i-th iteration of my for loop). I've been playing with everything I can think of (limited repertoire of thoughts though) and the best I've managed is for my EventListener to access the final set of data, whichever 'card' I click on. I've summarised and attached my code for the function, how to get back to the i-set of data from the EventListener attached to the i-th card. I can handle the PHP and MySQL side of things but am fumbling my way into the OOP of AS3.