Flash :: Visible Property Of DisplayObject
Nov 6, 2009For example I have a hierarchy of movie clips. mc1 is a child of mc, and mc2 is a child of mc1. Turns out that when I set
[Code]...
For example I have a hierarchy of movie clips. mc1 is a child of mc, and mc2 is a child of mc1. Turns out that when I set
[Code]...
When I add a DisplayObject to a DisplayObjectContainer (e.g. a Sprite to a Sprite) in a function, it seems that the DisplayObject is actually added not immediately, but after finishing the function.[code]...
View 4 RepliesThe following is entirely a math question. As we know, PerspectiveProjection delivers perspective transformations in 3D represented by the interdependent values of fieldOfView and focalLength according to the following formula:
focalLength = stageWidth/2 * (cos(fieldOfView/2) / sin(fieldOfView/2)
Q: How to get the visible on-screen size of the DisplayObject (Cube on the above-linked image) to which PerspectiveProjection has been applied? A more thorough description and illustrative code on the issue in ActionScript 3 lacks functionality for visible bounds of DisplayObject.
Has anyone got any alternatives to what Colin Moock has coded to GET VISIBLE WIDTH/HEIGHT OF A DISPLAY OBJECT in ActionScript 3? That esp. in perspective of DisplayObjects that have 3D transforms applied and visible dimensions of which you need to consider for a calculation.
View 2 RepliesI want to know which DisplayObject that is visible atposition x,y. Unfortunately, hitTestPoint returns true even ifanother DisplayObject lies above and blocks all visibility. Forexample:
View 7 RepliesWhen I add a DisplayObject to a DisplayObjectContainer (e.g. a Sprite to a Sprite) in a function, it seems that the DisplayObject is actually added not immediately, but after finishing the function.
See this example:
Code:
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
[Code].....
So we have a simple green button, and when it is clicked, there's a red Sprite constructed and added to the stage. But actually the red Sprite isn't visible until the onClick() function has been fully executed.
Why is that and what can I do for the red Sprite to be visible immediately?
Is there some (for the developer invisible) global paint() or update() function, that is not executed until some stack is fully executed or something?
I've been banging my head trying to figure out how to get this to work with no success... I have a class that extends MovieClip which loads a large image into it. This image has a mask applied to it to only display a specific section of the image. I need to be able to scale this MovieClip based on it's visible width & height while maintaining it's proportions.
I'm currently using Collin Moocks' approach (see it here:[URL]) to get the visible width and height of the movieclip, but I can't figure out how to get it to scale correctly based on those dimensions... Preferably I'd like to be able to set it's visible scaleX & scaleY properties similar to how you currently set the scaleX & scaleY, (i.e. movieclip.visibleScaleX = 1.5).
Code:
public function BrokenItem(originalImg:Bitmap,fixedImg:Bitmap)
{
[code]......
If I have a MovieClip with its "visible" property set to "false", would it aid performance to "stop()" its timeline? Or will that have no effect, since its not being rendered, anyway?
View 3 Repliesvar container:MovieClip = new MovieClip();
addChild(container);
var clip:MovieClip = new MovieClip();
[code].....
I would like to be able to quickly check if a given DisplayObject is a descendant (not in the inheritance sense - ie. child, grandchild, great-grandchild, great-great-grandchild, etc.) of another DisplayObject. There doesn't seem to be a native way to do this and I can only think of two ways to achieve it: Create the mother of all nested loops. Seems a bit, I dunno, wrong? Dispatch a bubbling event at the 'child' and check if the potential 'parent' receives it.
[Code]...
I want to control which DisplayObject is displayed on the front or on the back. I can control that with zIndex style in css.
View 3 RepliesI have a clip which is basically a set of button clips. When a button is clicked it fades (i used the ._alpha property) and finally when its 0 alpha, it removes itself (by using _visible=0 property). It works perfectly. Now when another button is clicked. I wanted the button which is currently not visible to restore its visibility. But using _visible=1; just isnt doing it (pastbutton._visible=1;). I tried a lot of trouble shooting, trace shows that the correct button path of the last invisible button is stored in pastbutton. But still when the next line says pastbutton._visible=1 still it doesn't restore the target button which is stored in the pastbutton variable.
View 1 RepliesI am having problems while creating object with actionscript, I am new to it and I am getting some errors. I am creating my object this way
Code:
var myMC:MovieClip = new MovieClip();
myMC.x = 50;
myMC.y = 50;
myMC.name = "hunterToken";
tCursos.addChild(myMC);
And it is created, so far everything's good
Later I try to access the visible property, and I get an error
Code:
tCursos.hunterToken.visible=false;
And I get this error:
Code:
TypeError: Error #1010: A term is undefined and has no properties.
at newSiteHTR_fla::mCursos1_1/go()[newSiteHTR_fla.mCursos1_1::frame1:157]
In Flex I've got a component, which is based on a Canvas.It looks like this (I removed the <mx:Script> for better reading):
<mx:Canvas verticalScrollPolicy="off" showEffect="showFX" hideEffect="hideFX" horizontalScrollPolicy="off" creationComplete="doComplete()" xmlns:mx="http://www.adobe.com/2006/mxml" width="63" height="63">[code]....
If I set customComponent.Visible to false, the component gets hidden (as expected). But doesn't trigger the hideFX at all. Am I doing something wrong? Or isn't this the correct way to use hideEffect and showEffect?
I want to some how control the visibility of some columns in my advance data grid. I have a data provider with 115 coumns out of which I want to hide few columns. I know the column index and header field of these columns. Is there some property in Advance data grid where I can specify this directly?
View 1 RepliesMy question is: Set parentSprite.visible = false will make all children in parentSprite all invisible, right? And is there any way to just make parentSprite itself invisible without effecting it's children?
View 2 RepliesI want to click on an object and make it appear and disappear. As the object is rectangular, I figured putting a white button the same size on a white background on a layer underneath the object would do this, but I can't seem to make it happen.I'm a complete novice, frustrated as I've been trying to achieve this all day and I'm sure it should be pretty simple, but could you give me the idiots guide. I know how to name an instance, make an object, script in actions on a separate layer. I would like to draw the button myself and give it an instance rather than drag it off the button component (as I can't work out how to make the component button white, change its size etc.!)
View 5 RepliesCode:
my_Dyn_Txt1._visible = false
cb1.onRelease=function()[code]....
When the checkbox (cb1) is clicked the "my_Dyn_Txt1" is visible. The problem I'm having is - when I move forwad and back in my frames the checkboxes which were clicked are not visible due to
Code:
my_Dyn_Txt1._visible = false
How can I make ("my_Dyn_Txt1"), a clicked checkbox STAY VISIBLE even after I move forwad and back in my FLA frames?
I want to make a little thing pop up when I put press a button... Would the best way to do this by doing a - movieclipname._visible = true/false
View 3 RepliesOkay, this should be relatively easy but I'm running into errors. My main character is visible in the beginning of the game (where the main menu is) and because I coded it so that all of the enemies don't spawn unless the main character is visible, the enemies spawn too. As a result, if you stay at the main menu for long enough, the score continues to go up, the health goes down when enemies attack, etc.
View 1 RepliesI'm trying to load a module and add it to a mx:box object called "mod". [code]...
View 1 RepliesI know how to draw a rectangle and add it to a DisplayObjectContainer,but do you see a simpler method to directly add a border to a DisplayObject? DisplayObject don't seem to have addChild(), so I would have to add it on the parent, which is not perfect in my opinion...
View 3 Replieswhen the video reaches 1 minute, a button appears. is there a way to hide the button again if the user uses the seek bar to go back to the 30 second (or any time before 1 minute) point?
View 2 Repliesi'm creating a visual editor in flex and need to let users export thier projects into Image format. But i have one problem: size of the canvas is fixed and when user add element which is out of these sizes some scroll bars added. And user continue working on the project. but when he want to take snapshot of the canvas he just get the visible part ot the canvas with scrollbars. how to get image of the fullsize canvas?
The only solution i found is to check the positions and sizes of canvas child objects and rezise it to fit them. then take snap and resize back. But it hmmmm... too complicated i think. Is there some "easy methods"?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
[Code].....
I have a getter within a class which is used to make my property skin:DisplayObject read-only. This class also has a property body:AvBody which is used to define the x y width height etc of the object, which in turn positions the skin.
What I want to do is disable access to the properties x and y on skin unless accessed from within the internal namespace (where AvBody is also located) Is this possible?
Note: I can't make skin any type other than DisplayObject (I can't even make skin a class that extends DisplayObject because it creates issues with library symbols).
I have DataGroup with custom item renderers, which can partly overlap each other. I have possibility to select these items. And I want selected item to be above others in the datagroup. But since DataGroup sets childIndexes (from left to right) to its children and we cannot change childIndex of items explicitly, selected item is above all items to the left and under all items to the right. So, what is the way to place selected item above others? I thought of using PopUpAnchor, but may be other solutions exist.
View 1 RepliesCan a flash.display bitmapData object be converted to flash.displayObject? i bump with an error when i tried to convert a bitmapData to DisplayObject
=> setChildIndex(DisplayObject(bitmapData),0);
"TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::BitmapData@35f4779 to flash.display.DisplayObject."
I'm wondering if there is a way I can bind a flex property to flash property?, the flash property is inside a swc file created in flash with the Flex Component Kit for Flash Professional, I can manipulate the flash component as a regular flex component, but I want to bind their properties, is there a way?
View 1 RepliesI have an empty mc on the stage called "infoloader" and I'm trying to dynamically load a mc called "my_info0" from the library into the empty "infoloader".My function references an XML array of thumbnails, which trigger movieclips to load into the FLVPlayback depending on which thumbnail is clicked.
====================
//function to load videosfunction callVideo(e:MouseEvent):void{var video_url = my_images[e.target.name].@VIDEO;vidplayer.source = video_url;vidplayer.play();}
[code].....