Controlling The Final Size Of A Sprite Object?

Feb 1, 2012

I'm rendering a xps file using flash (no MX or Spark), and I'm running into a sort of 'contradiction' that I'm unable to solve. [Note, that I'm trying to work only in core flash (e.g. Sprite, Shape, etc.), I've already solved (sort of) this issue using Spark.]

The pages of the xps file specify an explicit size. However, the content described (especially paths) in the xps file can sometimes extend outside of this area.

The problem is, I want the parent Sprite to have the size specified by the xps file, for example so scroll bars match the page size (not the sprite size), but in some cases the Sprite is much larger than this.

I've tried recursively going down and scaling everything UP, and then at the end scaling the parent container DOWN. Unfortunately, this causes translation problems with paths, and I assume it can also cause problems with bitmaps, etc.

Without using MX or Spark, is there anything I can do to control the size of the parent Sprite, other than scaling all the children independently?

View 1 Replies


Similar Posts:


Flash 10 :: Import Assets From Illustrator And Photoshop To Get Low File Size For Final Swf

Mar 31, 2012

I am looking for information on how to best import assets from Illustrator and Photoshop to get a low file size for the final swf. In particular:I have text that has been effected in Photoshop and a few images that can be brought in from Photoshop or illustrator. Right now I am exporting for web and bringing to Flash. Looks good but file size of end swf too big. I have gotten .fla files before from so-workers that have text or graphics as shape objects rather than images - is that possible and how is it done?

View 1 Replies

ActionScript 2.0 :: Add Some Code To Xml File That Will Change The Final Font, Size And Colour In Flash?

Jan 25, 2012

I am looking to add some code to my xml file that will change the final font, size and colour in Flash Action Script 2. I want to be able to have the choice of a few font sizes, styles and colours. Below is the AS2 script so far, and the XML.

stop();
var myGalleryXML = new XML();
myGalleryXML.ignoreWhite = true;[code].......

View 0 Replies

ActionScript 3.0 :: Remove A Sprite Object When Another Sprite Object Hits It?

Mar 23, 2011

I have a brick class where I have created a rectangle using flash.display.graphics.I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.I have another class called ball where I have created a circle with flash.display.graphics.The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.the error I get is shown only for the last brick that is created in a for loop.ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

at flash.display:isplayObjectContainer/removeChild()
at grid/ball_movement()// my function in enter frame event
The code I wrote in ENTER_FRAME is

[code].....

View 3 Replies

ActionScript 3.0 :: Remove A Sprite Object When Another Sprite Object Hits It

Mar 24, 2011

I have a brick class where I have created a rectangle using flash.display.graphics.I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.I have another class called ball where I have created a circle with flash.display.graphics.The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.the error I get is shown only for the last brick that is created in a for loop.[code]

View 1 Replies

ActionScript 3.0 :: Controlling Sprite With Classes

Jul 8, 2011

I used to know how to do this, but have since forgotten, and can't remember how, or find the resource I used to learn it in the first place. Basically, I want to move a sprite made in AS3, with an external class. This is the code I want to use as an example, just so I can get to grips with it, and apply it in other things.

[Code].....

View 3 Replies

Flex :: Controlling The Properties Of A Sprite's Child Sprites?

Dec 23, 2009

I have a sprite in which I have added other sprites. Something like:

var sp_main:Sprite = new Sprite();
var sp_group:Sprite = new Sprite();
for(i:int = 0; i < 10; i++)

[Code]....

View 1 Replies

ActionScript 3.0 :: Controlling Window Size In Flash?

Aug 27, 2011

how do you make a window go full screen in flash?

View 11 Replies

ActionScript 3.0 :: Pan Sprite Which Changes Its Size And Registration Point?

Apr 26, 2009

i am succesfully panning an image so far with this code:

Code:
my_mc.addEventListener(Event.ENTER_FRAME, panMe);
function panMe(e:Event):void {

[code]....

View 10 Replies

Actionscript 3 :: Maximum Stage And Sprite Size?

Oct 29, 2011

I'm making an action game and I'd like to know what should be the maximum size of the stage (mine is 660 x 500).Also I'd like to know how big a game-sprite should be. Currently my biggest sprites have a size of 128 x 128 and I read somewhere on the internet that you should not make it bigger because of performance issues.

If you want to make e.g. big explosions with shockwaves even 128 x 128 does not look very big. What's the maximum size I can definitely use for sprites?

View 2 Replies

Flash - How To Change Sprite Size On Launch

Feb 18, 2012

I'm totally new to flash, and I'm trying to build a very simple app. I have one as file in which I defined my class which inherent from Sprite, with the name mySprite. I have a fla which is of the mySprite class, and a size of 400x400(I must assign a size when define the fla). my question is, when this flash is launched, I want to read some data from outside (width&height) and change the flash windows size to these specified size. I tried many ways, but can't succeed. Every time the flash is launched, window size is 400x400.

View 1 Replies

ActionScript 3.0 :: Maximum Stage And Sprite Size?

Oct 29, 2011

I'm making an action game and I'd like to know what should be the maximum size of the stage (mine is 660 x 500). Also I'd like to know how big a game-sprite should be. Currently my biggest sprites have a size of 128 x 128 and I read somewhere on the internet that you should not make it bigger because of performance issues. If you want to make e.g. big explosions with shockwaves even 128 x 128 does not look very big. What's the maximum size I can definitely use for sprites?

View 4 Replies

ActionScript 3.0 :: Any Maximum Size Limit For Sprite?

Jun 19, 2009

Is there an upper bound to the size of a sprite in as3 / flash 10?

View 6 Replies

ActionScript 3.0 :: Flash Maximum Stage And Sprite Size?

Oct 29, 2011

I'm making an action game and I'd like to know what should be the maximum size of the stage (mine is 660 x 500).Also I'd like to know how big a game-sprite should be. Currently my biggest sprites have a size of 128 x 128 and I read somewhere on the internet that you should not make it bigger because of performance issues. If you want to make e.g. big explosions with shockwaves even 128 x 128 does not look very big. What's the maximum size I can definitely use for sprites?

View 3 Replies

ActionScript 3.0 :: Controlling The Size Of An Uploaded Art File To Display On Movie?

Mar 16, 2011

I've got the following file reference listener on a file to upload art for display on a flash movie. However, I want this to display only at a certain size. I tried the "easy way", but this ends up sizing down my whole movie. Where should I insert the code to get the uploaded file to show on my flash movie only to a certain height and width? "chip_clip" is the empty movie clip this is being uploaded to:

var file:FileReference = new FileReference();
file.addEventListener(Event.SELECT, fileSelect);
file.addEventListener(Event.COMPLETE, fileComplete);

[Code].....

View 2 Replies

ActionScript 3.0 :: Width Of DisplayObjectContainer - Make The Size Of Sprite Is Not Affected By Its Children?

Jan 30, 2010

look at the following codes first
 
var sp:Sprite = new Sprite();
trace( sp.width );                    // the result will be 0
var mc:DefinedMC = new DefinedMC();          // assume that DefinedMC is derived from movie clip, and the width of mc is 100
sp.addChild(mc);
trace( ap.width );                    // the result will be 100
 [code].....
 
so the size of an instance of Sprite is affected by its children.is there any class derived from DisplayObjectContainer whose size is not affected by its children, or is there any method that could make the size of Sprite is not affected by its children.

View 7 Replies

ActionScript 3.0 :: Get An Object To Increase In Size The Lower It Goes Down The Stage And Decrease In Size The High It Moves Up The Stage?

Dec 29, 2009

I'm trying to get an object to increase in size the lower it goes down the stage, and decrease in size the high it moves up the stage.

It only needs to increase or decrease by a small amount. Basically, it's for a game character. To ad realism to his movements, it would be nice to have this feature.

This is where i'm up to so far:

Code:
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;

[code]....

I think I need something like:

if (object moves up)
decrease
else if (object moves down)
increase

View 6 Replies

ActionScript 3.0 :: Controlling Object In Another Movie

Mar 6, 2009

I'm pretty sure this is possible, but I can't get it to work. I have a main movie and in one frame I am loading in another swf. The user goes through the activity in the loaded swf and then needs to continue on in the main movie. I've added code in the last scene of the loaded swf that I thought would allow it to navigate to the next frame in the main movie:

PHP Code:
function next4(evt:MouseEvent):void {
this.parent.parent.gotoAndStop(4);
} continue2_btn.addEventListener(MouseEvent.CLICK, next4);

But when I play the main movie, I get the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ELC_fla::MainTimeline/frame3()
I have tried to communicate to the continue button in the loaded swf from the main movie, but that didn't work either.

View 7 Replies

ActionScript 3.0 :: Controlling An Object Placed By A Class?

Jan 9, 2011

i have two movieclips on stage, one load as a class an mc with animation, the other load a button...how can i send the message, comunicate both clases to let the button start the animation?

View 4 Replies

ActionScript 3.0 :: How To Return Sprite Object

Dec 11, 2011

I want to load two picture and add every picture to every sprite object,such as picture a to sprite1 and picture b to spriteb,I know I can load a pictue by following code:

loadImage('a');loadImage('b');private function loadImage(imagePath:String):void {  var loader:Loader = new Loader();  loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded); loader.load(new URLRequest(imagePath));}private function

[code].....

View 3 Replies

ActionScript 3.0 :: How To Add Sprite Object With Animation

Mar 18, 2012

What I'm about to ask might be completely nonsense/basic or something else. Because my AS knowledge is too little. Hope I can explain correctly. I am tring to create a sliding banner animation dynamically. The reason that I create dynamic is that I want to load banner images and headlines from XML file.

[Code]...

View 4 Replies

Actionscript 3 :: Add Sprite Object With Animation?

Mar 18, 2012

What I'm about to ask might be completely nonsense/basic or something else. Because my AS knowledge is too little. Hope I can explain correctly

I am tring to create a sliding banner animation dynamically. The reason that I create dynamic is that I want to load banner images and headlines from XML file.

So I found a sample project with .as and .xml file. It does what I want but it has no animation. You can see the demo here: [URL] As you can see, there's a transparent info panel below. Here's the code how it is being created:

private var infoPanel:Sprite = new Sprite();
private var titleField:TextField = new TextField();
private var description:TextField = new TextField();

[Code].....

View 2 Replies

ActionScript 3.0 :: Way Of Duplicating A Sprite Object

Feb 2, 2007

Does anyone know a way of duplicating a Sprite object.

View 9 Replies

ActionScript 3.0 :: Possible To Return Sprite Object?

Dec 12, 2011

I want to load two picture and add every picture to every sprite object,such as picture a to sprite1 and picture b to spriteb,I know I can load a pictue by following [code]...

View 2 Replies

ActionScript 2.0 :: New Resize() On Sprite Object?

Feb 28, 2007

I'm making a resize function that has to resize a Project object that extends Sprite.

But I keep ketting a type coercion error:
TypeError: Error #1034: Type Coercion failed: cannot convert AS:: Project@318ff89 to mx.core.IUIComponent.

I've tried casting the Project object to an UIComponent or DisplayObject, but this also throws a TypeError.

[AS]var resizeTarget:UIComponent = new UIComponent();
resizeTarget = UIComponent(target.getChildAt(0));
var myResize:Resize = new Resize(resizeTarget);[/AS]

So basically should I try avoiding the use of Sprites in Flex?

View 4 Replies

ActionScript 3.0 :: Controlling Object From Child .as File?

Jan 24, 2010

If I import pgming from one AS into an overall one like this:
 
import asFiles.slideshow.*;
public var slideshowAS:Slideshow;
//then later:

[code]...
 
how do I control one object that is within that child .as file from the parent .as file?so for instance if in the slideshowAS there is an item called "nextBtn" and I want to be able to do something with it in the parent main menu .as file.

View 15 Replies

ActionScript 3.0 :: Controlling Alpha For An Object On The Timeline?

Sep 14, 2011

I recently bought an mp3-player coded in Flash and it works great, except for the fact that I do not want it to appear constantly on the timeline.

The mp3-player is generated throught code, so I was wondering if there is a way to control the alpha of a variable named mp3playerContainer and set it to 0? I have navigation points on frame 25 and 55 where I want this mp3player to not be visible. Could it be an idea to use "currentFrame", so that if currentFrame equals 25 or 55, then alpha of the variable mp3playercontainer will be set to 0?

View 2 Replies

ActionScript 3.0 :: Controlling Object From Child .as File

Jan 24, 2010

If I import pgming from one AS into an overall one like this:

[Code]...

how do I control one object that is within that child .as file from the parent .as file? so for instance if in the slideshowAS there is an item called "nextBtn" and I want to be able to do something with it in the parent main menu .as file. If you could even direct me on what to search under I that would be very helpful! I tried googling it but did not know how to search for it.

View 2 Replies

ActionScript 3.0 :: Sprite Object - How To Get Smooth Text

Nov 22, 2009

I have created instance of textField Object and set property scaleX and Y in large and then I my textfield set into Sprite Object. I saw my text in ugly font . How can I have my text in smooth .

View 1 Replies

ActionScript 3.0 :: Two Sprite Object Directing To Same Event

Dec 12, 2011

I have two sprite object and they direct to same event like follows:
sprite1.addEventListener(MouseEvent.CLICK, mouseEventHandler);
sprite2.addEventListener(MouseEvent.CLICK, mouseEventHandler);
private function mouseEventHandler(event:MouseEvent):void {
//how to do it here?
}
When click spirt1 or sprite2,it will call mouseEventHandler function,my question is how to determine which sprite is click in mouseEventHandler function,sprite1 or sprite?

View 1 Replies







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