ActionScript 3.0 :: Get / Set Correct Height For Masked Object

Sep 12, 2009

I'm building a class for a data grid that creates everything dynamically, and allows the user to add buttons to a cell easily. If the user defines a height for the dataGrid that's smaller than the content, the content is cropped and a scrollbar is added. Now here's where my problem occurs. Once the content is masked, and you then try to access the .height property of the dataGrid, it will return the height of the dataGrid + the masked content.So I added a get/set override function for the .height property. Now this works, but only if I'm constantly updating the height as I create my dataGrid. What I'm curious about, is how (when the properties aren't overridden) when you add a child to a MovieClip, it's .height property is updated automatically? For example if you have

ActionScript Code:
var par:MovieClip = new MovieClip();
// each Cell is 20px tall.
var cell1:Cell = new Cell();
var cell2:Cell = new Cell();
par.addChild(cell1);
par.addChild(cell2);
trace(par.height);

The .height will equal 40px. Is there a set somewhere inside addChild that updates the .height property, or is there a different way that they do it? Basically I'd like to override the .height property after a certain amount of the dataGrid is built (to compensate for the difference in masked content height), but since the override happens from the very beginning, I'd like to know if there's a better way of setting my MCs height rather than constantly setting it as I build the grid. Or better yet, is there a way to get the proper height of an object that contains masked content without having to override the height?

View 1 Replies


Similar Posts:


Flex :: Get The Width And Height Of A Masked Area?

Dec 14, 2011

I am loading an external swf using the SWFLoader component. The swf that is being loaded is masked so that only a portion is being shown. However, when it's loaded the actual size of the swf (loader.content.width/loader.content.height) is the complete swf including the masked area. Therefore, the loaded swf does not display properly in the itemrenderer Is there a way to to grab the size of the just the masked area as opposed to getting the size of the entire swf's contents? also i need to re size the masked area

View 1 Replies

ActionScript 3.0 :: Masked DisplayObjects And Getting Height/width/dimensions?

Oct 28, 2009

anyway, so i'm having an issue when getting the dimensions of an image that is masked. I want to get only the dimensions of the visible image, but AS3 seems to only return the height/width of the whole image, even the areas that are not visible (because of the mask).

I could create a custom class that extends the DisplayObject and overwrites the height and width getter to return the dimensions of the mask, but my problem is that I'm placing these masked images into a container DisplayObject, and scaling that container to fit the browser window.

View 6 Replies

ActionScript 3 :: CreationComplete Event Does Not Show Correct Height / Width

Apr 27, 2011

I have an issue where using MXML, the height and width properties of myBox is correctly acquired but using ActionScript the correct height and width acquired is not correct.

my:Tab extends NavigatorContent (This is NOT the tab in a Tab Bar)
com:myBox extends BorderContainer.
<mx:ViewStack id="viewstack_main" width="100%" height="100%" creationPolicy="all">
<my:Tab label="My Tab">
<s:Scroller height="100%" width="100%">
[Code] .....

In the constructor of myBox I set the percentWidth and percentHeight to both 100. In the creationComplete event of the same myBox, I need to access the height and width. This works all ok with the MXML. However using ActionScript I need to add another tab.

var navContainer:Tab = new Tab();
viewstack_main.addElement(navContainer);
var scroller:Scroller = new Scroller();
scroller.percentHeight = 100;
scroller.percentWidth = 100;
[Code] .....

But unfortunately, in the creationComplete event of box, the height and width properties are NOT what is expected (the height & width after setting 100%). It is 112. Why this works with MXML but NOT ActionScript?

View 2 Replies

ActionScript 2.0 :: When Publish A Projector .EXE File For Windows, Then, The Width Is Still Correct, But The Height Is Higher Than 62?

Nov 17, 2003

My Stage size is 126*62. (it's a small animation).- When I publish the .SWF, no problem.- When I publish a projector .EXE file for windows, then, the width is still correct, but the height is higher than 62 : I got two small white bands beside top and bottom of my stage,see ?I don't understand why there's such a difference between publishing a SWF or EXE. And I'm afraid this also happens whatever the Stage size is (small or big, I mean) : you always get these blank bands on the top and the bottom, don't you ?

View 1 Replies

Html :: <object> Height Ignores Parent Div Height?

Aug 9, 2011

I have a problem with an flash object. The object is an expanding topbanner, but when retracted, the on mouse over effect still appears on the invisible part of the banner. The code is the following:

<div id="exp_banner" style="width:930px; height:180px; overflow: hidden; position: absolute; z-index: 100;">
<object type="application/x-shockwave-flash" data="test.swf" width="930"

[Code].....

I have tried to add a style height to the object with an height of 180px, but then the banner scales down.

View 1 Replies

Masked Object Invisible When Wmode Transparent?

Mar 17, 2010

I have several objects that share a single mask. I can see all of them when wmode is set to window but i want the background image on the page to show through the flash and have designed the flash around that. However when I set the wmode to transparent some of the objects don't render at all even though others do and they share the same mask.

View 3 Replies

IDE :: Inverse - Hiding The Masked Object Instead Of Revealing It

Jun 9, 2009

I've taken this problem far and wide, and it's a common one, too: Someone wants to use a mask inversely, hiding the masked object instead of revealing it. The only coded solution is to create a bigger "stage" mask with the inverse mask cut out. I understand the process, and have a slight grip on methods of executing it. Too bad it still will not work properly. I have employed two solutions to no avail. There was this simple option, and then there was this slightly harder option.

And where it works for some people, it is not working in my instance. If you look at my files, the masks cut out rather strangely. Is there something different about this situation that requires a different line of code, or am I simply using it wrong? To show you how they worked out, this is the goal: And this is what I ended up with after option 2: Because the object will be squishing and changing shape, creating the mask frame by frame would be a hassle. Changing the shape of a solid mask is a lot easier than moving the particular points of a "stage" mask manually.

View 2 Replies

Flash :: Adding A Loaded Image With AddChild To A Masked Object On Timeline

May 20, 2011

I have a Movie Clip object with a timeline, and it has 3 layers: a layer to stop the timeline at the last frame, a layer with regular drawing with mask attribute and a layer containing a target movieclip with the instance named 'target', that is masked by the layer above.

The drawing is very simple, not even a movieclip, just vector drawing. It's supposed to show the target movieclip only on regions where the mask layer has some drawing, right?

So, I created the method to load an image, listen to the complete loaded event and add the image to the target masked movieclip, but it disappears after the first frame! If i delete the layer with the mask drawing, works fine.

Here's a smaller version of the code.

package
{
import flash.display.*
import flash.events.Event;

[Code].....

View 3 Replies

ActionScript 2.0 :: Correct Use Of Var Object?

Dec 30, 2009

I am trying to store the x and y position of a mc and thought I would do it using object. I am getting a compile error but do not see why?

"Case insensitive identifier 'object' will obscure built-in object 'Object'"

Code:
var some_mc = new object ({_x:150, _y:50});
trace("some_mc x position is " + some_mc._x);

View 3 Replies

Javascript :: Php Null Object Given By IE But Other Working Correct

Mar 1, 2011

there is a problem with IE browser it does not recognize object HTMLEmbedElement and not proceed for further execution . i have no choice because there is nothing to be updated in programming code

View 2 Replies

ActionScript 3.0 :: Get JSON Object In Correct Order?

Dec 7, 2009

I'm getting a large JSON string and decoding it into an object, i'm looping through this object to create the interface. The problem is it seems to build the interface in a random order, is this because actionscript 3 loops through the properties of the object randomly?

View 3 Replies

Flash :: Determining Visible Area/invisible Area Of A Masked Object?

Sep 29, 2011

I have a movie clip named circle_mc(see the image on the link below) and a mask object(movie clip) which determines visible area of the circle. User can change the portion which is visible (extend the red area and make it red+blue, gray area is invisible). I need to find proportion of visible area to invisible area (red+blue/gray) so that I can calculate angle.

View 1 Replies

ActionScript 2.0 :: [Ask] Object Moving In Limited Area Or Masked Area

Jun 15, 2011

I have Particle animation like this this PHP Code:

[Code]...

But i want that Object moving in limited area or masked area. I add masked area like this PHP Code:

[Code]...

But it still not working. Any advice ?? or correction in my script code?

View 1 Replies

Flash :: Finding Correct Scope Of An Object For A Callback?

Dec 11, 2009

I'm working on writing a tweening class in as2 that has a callback variable and I can't seem to find a good way to get the scope without specifically passing in a scope variable as well. This tweening class needs to work in classes as well as on the timeline. Here's what my codes looks like right now.params.scope[ params.onComplete ]( params.onCompleteParams );params is an object passed into the class. This works but I don't want to have params.scope in there.

View 1 Replies

Flex :: Correct The Objection About Dymanic Object Type By FlexPMD?

Nov 21, 2011

I have the code in one of my flex file used as labelFunction in a DataGrid.When I run the FlexPMD to do the code review, it generates an objection about the dynamic type object used in the following method signature and it suggests to use strongly type object.

public function getFormattedCreatedTime(item:Object, column:DataGridColumn):String {
var value:Date=item[column.dataField];
return dateFormatter.format(value);[code]....

View 2 Replies

Actionscript 3 :: Correct Way Of Making Variable Accessible To A Child Class / Object

Mar 4, 2011

When you initialize a new object, how can that class have access to a variable from the parent?In this case Blob needs to be able to access scale?[code]

View 2 Replies

ActionScript 3.0 :: Get The Depths Of All The Blocks To Be At The Correct Levels At The Correct Times

Dec 30, 2009

I'm trying to get the depths of all the blocks to be at the correct levels at the correct times so that the 3d effect is maintained. I've tried many things, but have had little success. All the instances of the blocks are stored in an array, but since it's adding them in accordance with when they're added to the stage, it doesn't help me locate them to swap depths. Is there a way to arrange them by location on the board?

View 4 Replies

Flash :: Finding The Correct Scale Value Within A Scaled Object To Maintain The Aspect Ratio Of A Video

Jan 20, 2010

I have a video inside of another movieclip. When I go full screen, I scale up the outer movieclip to fit the screen. So that OuterMovieClip.width is equal to screenWidth etc. How do I maintain the aspect ratio on my video so it does not get distorted? Whats the proper math for that?

View 1 Replies

Actionscript 3 :: Get Unrotated Display Object Width/height Of A Rotated Display Object?

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

ActionScript 3.0 :: How To Increase Height Of Object

Jun 13, 2010

I am a very fresh guy in flash, I have experince in Javascript , C++ and other programming languages. So I am very much interested in doing task with Action script and get results which are not possible by GUI.I want increase the height of Movie clip using action script, So I tried to increase .height property the height increased but It increased in both direction top & bottom) I want to keep it bottom fix. I tried ScaleY, too but no luck.Somehow we can adjust the bottom after resizing but it won;t give good effect when we are using tweening or other animation.

View 1 Replies

Actionscript 3.0 :: Getting Object/embed Height Of Swf?

Sep 27, 2009

I want to be able to access the height of a swf when loaded into an html container. So if in the object/embed params the height is 100% I want to be able to get that value in the swf. I know I can't use the parameters value of the loaderInfo class of root as that only contains flashVars and not the embed params.

View 2 Replies

Flash :: Get Width And Height From Loader Object?

Feb 22, 2010

package
{
import flash.display.*;

[code].....

View 3 Replies

HTML :: Firefox Object Height Ignored With Data

Apr 27, 2010

I have a flash video loading in a modal window. It works in others browsers but not Firefox. Firefox opens the modal window to the correct width of the object, but with no height. I have come to learn that Firefox does not recognize <param> and instead uses the data attribute. However, when I remove this attribute, the modal opens with correct height. Here is the code the modal window loads:

<object width="720" height="520" type="application/x-shockwave-flash" data="proxymovie.SWF?file=proxymovie.MP4">
<param name="movie" value="proxymovie.SWF?file=proxymovie.MP4" />
<img src="images/poster.png" width="720" height="480" alt="" title="Download the video below" />
</object>

View 2 Replies

ActionScript 3 :: How To Get Object Width And Height In Flash

Nov 27, 2011

I thought this would be straight forward but I'm having trouble repositioning my content. I have a button instance named rollOne, When I roll over the button I want to load an swf object but not on top of the button so I want to find out what the button's width is so I can reposition the dynamically loaded content. I thought rollOne.width would return the width, but it only returns 0 the same goes for height.

rollOne.addEventListener(MouseEvent.MOUSE_OVER, fetchQty);
function fetchQty(event:MouseEvent):void {
myContainer.x = (rollOne.x + rollOne.width);
myContainer.y = (rollOne.y + rollOne.height);
var img1Request:URLRequest = new URLRequest("8032697883620.swf");
var img1Loader:Loader = new Loader();
img1Loader.load(img1Request);
myContainer.addChild(img1Loader);
trace(rollOne.width);
}

View 2 Replies

ActionScript 3.0 :: Width And Height Of Collada / Dae Object

Jan 24, 2009

Im trying to access the width and height of a dae/collada object.myDAE.width does not work. If you have any ideas as to which class this info is contained it would be a massive help!

View 1 Replies

ActionScript 3.0 :: Calculate Width And Height After Object Rotation

Jul 31, 2009

I am tweeing a bunch of rectangles randomly on stage.

Code:
TweenLite.to(thumbArr[i],1,{
x:Math.random () * (stage.stageWidth - thumbArr[i].width),
y:Math.random () * (stage.stageHeight - thumbArr[i].height),
rotation: Math.random () * (60) - 30});

the problem is that after I added random rotation (between -30 and 30 degrees), the corners of my rectangles are still sticking out of the stage at the end of the tween.

If I trace objects width and height after the rotation I get the new values but this still doesnt help me because I am tweening to that rotation.

Code:
mc.rotation = 20;
trace(mc.width);
trace(mc.height);

View 5 Replies

Flash :: Jquery - Read Width & Height Ob An Object?

Nov 24, 2009

Is there any way to read the width and height of a flash object using jQuery?

View 1 Replies

Arrays :: Positioning Using Previous Object Y Coordinate And Height

May 4, 2011

trying to loop out some pictures using a for loop and cant get them to be posiotioned directly beneath the previous picture, I have set the height number in my xml where I get the pictures from.[code]This is how the code should look like if you are trying to place pictures directly beneath the previously added picture using a class with parameters, in this case the "LoadExternaly" is that class.

View 1 Replies

ActionScript 3.0 :: Command To Get The Object Height From The Html Page?

Jan 20, 2009

I'm missing the command to get the object height from the html page. I just want to set the original height and width to a sprite background. The object in the html is set dynamically from the server.

Also when I resize from the authoring window the background doesn't change size where:

pageBkg_mc.height=stage.height;
pageBkg_mc.width=stage.width;

I looked in the properties panel and when I clicked on the instance of the movie clip the option to set the size was disabled. Not sure why. So I deleted the instance and put it in a new fla. The options were enabled. Then I went back to my old fla and dropped a new instance of the background there again. Added the same instance name and sizing was enabled again. Is there a reason why it became disabled?

I also updated this code and it works fine now.

Code:
package {
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.display.StageAlign;

[Code]....

View 0 Replies







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