Flash :: Alternatives To Colin Moock's Approach To Visible Width/height Of DisplayObject?

Jan 12, 2010

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 Replies


Similar Posts:


ActionScript 2.0 :: Basic Text Scroller By Colin Moock?

Feb 22, 2005

I've seen this tutorial in the Actionscript Forum and it's nice : ) Unlike before, I always use the component scroller that came with Flash MX. Now i'm really learning.I also come across numerous flash web sites in the past few weeks. They also have fetures like news, blog and etc. with customized scroller but their scroller scrolls with an ease? You know, it scrolls smoothly like it's sliding

View 4 Replies

Professional :: Publishing A Flash Video: Player Not Visible - Height And Width Referenced 3-times In Html?

Mar 5, 2010

When I publish my FLV video using Flash CS3 and the "SkinUnderAll" option...the player controls are not visible unless I change the height & width in the html file Flash created.But, Flash shows the height & width 3-times in the html.
 
Question-1: Why 3-times? What does each of the 3 Height & Width references do?
 
Question-2: How should I modify the code to be able to see the entire video and the player controls?

It seems if I change all 3 everything just gets bigger and bigger.
 
1 - I import it into Flash CS3 on a PC w/XP Pro using... File | Import | Video take all the defaults and choose "Skin Under All" as the player option.
 
2 - In "Properties" panel at bottom of screen Flash shows the video as 640x480
 
3 - I then click File | Publish to publish the video. Flash creates all my files for me.
 
MyVideo.fla
MyVideo.flv
MyVideo.html
MyVideo.swf
SkinUnderAll.swf
AC_RunActiveContent.js
 
4 - I then put the folder with the files on my website.
 
5 - The video plays but the player controls are not visible.
 
6 - I see the Height & Width referenced 3 times in the html file Flash created for me (and none are 640x480, they are 550x400 !)
 
7 - I try changing the 550x400 to 640x480 in all three places... no good. Even at 1000x1000 the entire player is not visible. Everything just gets larger.
 
What are each of the 3 references to Height and Width in the html file Flash Creates and which should I change to simply show all the player controls?

View 2 Replies

ActionScript 3.0 :: Height / Width Of Bounding Box Of Visible Area?

Jun 23, 2008

In many cases the pieces have artifacts outside of their visible area. For example, a piece can have a picture of a dog's face, but one of the long ears is off to the side, outside the visible region of the piece. The path data is extremely detailed, so our designers didn't crop it off. They used a mask (at least I think it's a mask, I'm not a graphics guy and know little about that stuff) and this makes it invisible in Flash, when we turn them into movie clips. Also, in Flash when I look at the width and height of the piece, it does reflect only the visible area.However, in ActionScript when I try to get the width and height using, for example

Code:

pieceObject.width

I get the width of the piece including the part that is hidden, i.e. a larger width than the visible area.Is there a way in AS 3.0 to get the height / width of the bounding box of visible area only?

View 6 Replies

ActionScript 3.0 :: Flash Referencing Stage.width/height References Mc.width/height?

Jul 29, 2010

I am trying to reference to top level (stage) width and height of the main stage for the placement of something located inside a movieclip on the stage.

My code is:
Code:
my_loader.x = (stage.stageWidth - my_loader.width)/2;
my_loader.y = (stage.stageHeight - my_loader.height)/2;

But this seems to just relate to the width/height of the mc that my_loader is nested in...

I have tried the following and had no luck:

stage.stage.stageWidth
root.stage.stageWidth
parent.stage.stageWidth
MovieClip(root).stage.stageWidth

View 8 Replies

Flex :: 4 - Move All TitleWindows Instances Within The Visible Area After Application Change It's Width / Height?

Jun 8, 2011

Is there a nice and not much processor consuming way to move all TitleWindow instances within the application visible area when the application been scaled - change it's width or height ?

View 1 Replies

ActionScript 1/2 :: Load External Image Of Different Height & Width Into Same Height And Width

Jun 12, 2009

i want to load external images of different height and width into same height and width.

View 3 Replies

ActionScript 2.0 :: Load External Image Of Different Height & Width Into Same Height And Width?

Feb 24, 2010

i want to load external images of different height and width into same height and width.

View 0 Replies

Flash :: Visible Property Of DisplayObject

Nov 6, 2009

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]...

View 4 Replies

Flash :: DisplayObject Isn't Visible Immediately

Aug 17, 2011

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 Replies

Actionscript 2.0 :: Change Width - Height And Width / Height Ration In Flv?

Mar 25, 2011

I would like to use a movieclip to load a flv video. The problem I have is that I want to change the video dimensions. I've tried several software to change the video dimensions but as far as it seems all of them keep the same height-width ratio than in the original video. Is there any software that would allow me to change the height and width without keeping the same height/width ratio as in the original video file?

View 1 Replies

Flash :: Get Visible Size Of DisplayObject With Perspective Projection

May 2, 2010

The 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.

View 1 Replies

Actionscript 3 :: Canvas Total Width (visible Width + Hidden Scrollable Part)?

Apr 19, 2010

It's probably a no brainer, but I've spent the last 40 minutes or so looking for it to no avial.

I have a Canvas control with a fixed width and a horizontal scrollbar.I'm trying to find the actual width of the control.The .width (fixed width) + the part being revealed by the scrollbar.I tried explicitWidth, width + maxHorizontalScrollPosition, and some other combos but non of them hit the spot.

View 1 Replies

ActionScript 2.0 :: Change Widht, Height And Width/height Ration In An Flv Video File?

Mar 25, 2011

I would like to use a movieclip to load a flv video. The problem I have is that I want to change the video dimensions. I've tried several software to change the video dimensions but as far as it seems all of them keep the same height-width ratio than in the original video. Is there any software that would allow me to change the height and width without keeping the same height/width ratio as in the original video file?

View 3 Replies

ActionScript 3.0 :: Which DisplayObject Is Visible At Position X,y

Mar 3, 2009

I 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 Replies

Professional :: SimpleButton.width Doesn't Change - Width And Height Remain 0

Jun 1, 2010

I am looking at the SimpleButton entirely wrong. Here's what I'm doing (inside of a MovieClip):

[Code]...

the close_btn.width and height remain 0. Am I supposed to just rely on the DisplayObject members of the SimpleButton completely and ignore width/height/x/y or what?

View 2 Replies

Flash :: Flex - 3D - AS3 - Convert Degrees Of Rotation To Visible Height

Nov 5, 2009

I need to know what the visible height of a display object will be after I change it's rotationX value. I have an application that allows users to lay out a floor in 3D space. I want the size of the floor to automatically stretch after a 3D rotation so that it always covers a certain area. EDIT: I guess what I am really trying to do is convert degrees to pixels.

On a 2D plane say 100 x 100 pixels, a -10 degree change on rotationX means that the plane has a gap at the top where it is no longer visible. I want to know how many pixels this gap will be so that I can stretch the plane. In Flex, the value for the display objects height property remains the same both before and after applying the rotation, which may in fact be a bug.

EDIT 2: There must be a general math formula to work this out rather than something Flash/Flex specific. When viewing an object in 3D space, if the object rotates backwards (top of object somersaults away from the viewer), what would the new visible height be based on degrees of rotation? This could be in pixels, metres, cubits or whatever.

View 5 Replies

ActionScript 3.0 :: AddChild() - DisplayObject Isn't Visible Immediately

Aug 17, 2011

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.

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?

View 2 Replies

Actionscript 3.0 :: Scale DisplayObject Based On Visible Bounds

Nov 5, 2010

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).

View 2 Replies

Flash :: Change Width / Height Of SWF?

Jul 26, 2011

I'm trying to edit an HTML that uses swfobject to load a flash file.

What I'm trying to do is to reduce the size of the SWF file.

I've tried editing the height and width parameter within the swfobject(), but that didn't work.

I tried reducing the width height in the HTML css, but that also didn't work..

How can I pass a 'width' or a 'height' parameter to the swfobject so it will actually load the swf in a smaller or 'zoomed out' way?

View 2 Replies

ActionScript 3.0 :: DisplayObject.height All Messed Up?

Nov 29, 2009

It seems that the getters and setters for the height are all botched up when the DisplayObject has any rotation applied to it at all.The getter for the height returns the total height of all the bounds.The setter for the height sets the height regardless of rotation.If you set the same value for height several times in a row, you will get about 3 different results until it stays at the same result.If the heigt's getters and setters are different, imagine the ramaflacations involved, first and foremost setting properties via "+=".Just posted up a quick example: (ZIP with SWF is attached - FLA can be made available upon request)The properties "width", "height", and "rotation" are applied in that order as listed, but setting them in a different order will affect the result differently, but I don't have the time for that.

View 3 Replies

Actionscript :: Flash MovieClip Width And Height Always Zero

Jan 26, 2010

I'm loading a flash MovieClip (Test.swf) like below. The problem is I can't read the size of mc (mc.width and mc._width both return 0, for the height as well), but I need to scale it. I have the stage size, I can scale, but I don't have the size of Test.swf, so I can't scale it to fit into the stage... ActionScript2, not actionscript3. If it was 3, I could get the value from the loader, but with as2??? The problem is I don't have control over the swf I load, so I can't put it's dimensions in the first frame...

[Code]...

View 1 Replies

Flash :: Get Width And Height From Loader Object?

Feb 22, 2010

package
{
import flash.display.*;

[code].....

View 3 Replies

Flash :: Dynamic Height And Width With Swfobject?

Mar 27, 2010

swfObject embed has the following signature,swfobject.embedSWF(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn)with width and heigth required attributes,What can I do to signify dynamic height and width.

View 4 Replies

HTML :: Flash - Height And Width Of SWF File

Apr 18, 2011

In the following code Only the button image has been embeded into the flex code. But in the html object or embed tag why the height and width has to be specified. Even though for this is a normal button if we do not specify the height and width there seems to be some error

HTML
<div align="center"><br />
<div style="display:block;width:100px;height:100px;" id="audio"
class="testsound" align="center"/>
<p class="clickable">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="100" id="myMovieName">
[Code] .....

View 3 Replies

Flash :: Get Embed Tag's Width / Height In Actionscript?

Jun 14, 2011

I am using the stage ScaleMode as NO_SCALE and want to know the width and height specified in HTML in the embed tag. Is there a way to go about it?

View 1 Replies

Flash :: Stage/root Width & Height Always 100?

Aug 7, 2011

trace(root.width);
trace(stage.width);

Both these return 100. Same for height. The stage has been set to 1024x620 in the editor.I'm using CS5, Flash version 10, windows7 64-bit.I don't get what's going wrong here. I'm trying to center something and it keeps coming out like this.

View 1 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

Flash 10 :: Bitmaps Less Then 4px In Width / Height Not Working?

Aug 23, 2010

I've come to notice recently while using bitmap objects in the Flash CS5 (maybe before as well) authoring environment that are less than 4 pixels in width and/or height that they are treated as though they are 4 pixels wide/tall. Many of the bitmaps I use are 1 px wide in one direction or the other, and they are stretched to fill an area. Lets say I have a bitmap that is 20px tall and 1 px wide, and I stretch it to be 100px wide. The "hit area" of the object, or parent objects that contain it, is 400 px wide. So even if you click a significant distance away from the object, it is still selected, and anything underneath that invisible area can't be selected.

I've also noticed that when exporting a frame as an image, the smallest the width/height may be is 4px, and when I click the Edit button in the Properties panel with a Bitmap instance selected, it opens up in Photoshop CS5 and is 4 pixels wide! I'm wondering if for some reason Flash can't handle bitmaps less than 4 pixels in width/height and is treating it as if it IS 4 pixels wide, possibly even adding 3 extra columns of transparent pixels, because if I do the same thing manually, naturally it acts identical to the way Flash treats the 1px wide version. But why? Why can't Flash handle small bitmaps? Seems to me that's more efficient than quadrupling the amount of memory required.

View 0 Replies

ActionScript 2.0 :: Any Way To Get Image Width And Height Within Flash?

Aug 12, 2004

Is there a way to get a jpg's image and height (before dynamically loaded) within flash? The only way I could do it was to load the image into a containerMC, but I would like to do it before the image loads. the only other way I could think of was to send the image link to a php script and returning its height/width to flash.

View 5 Replies







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