ActionScript 3.0 :: Keep Transparency When Copying Displayable Object?

Feb 8, 2010

When I use Bitmap.draw() to copy a displayObject do I lose the transparency? In one case I might be copying a .png file that had transparency and in another case I'm copying a composite image made up of multiple DisplayObjects. It seems as though the resulting images are bitmaps with no transparency.
 
Is it possible to duplicate .png files in memory, preserving the transparency and having unique objects for using in different places in the display?

View 13 Replies


Similar Posts:


AS3 :: Flex : Determining When A Displayable Object Is Finally Displayed?

Apr 7, 2011

I am looking to determine the final event or location where it could be determined that an Image, or a UIComponent, has been rendered to the user. I need to know when it has been displayed and thus is, presuming it's not covered up or at a silly location, visible to the user. In the UpdateComplete Event Documentation it says:

This is the last opportunity to alter the component before it is displayed. All properties have been committed and the component has been measured and layed out.Overriding the dispatchEvent on an Image shows that the UpdateComplete Event is the last one that it dispatches after an update of the .source property. Breakpointing and walking the code after that event shows that the LayoutManager seems to finish with it's actions before the Image is displayed.

I have watched the dispatchEvent on and updateDisplayList on the canvas container and no dice. I assume that there is some higher (lower) object that I might be able to extend or listen to that would give me that final piece of information.

NoisyImageTest.mxml - test application for watching the event loop. If you breakpoint at line 22 you see the last updateComplete event but the image is not yet displayed. Stepping through the code from there, it exits the thread after the LayoutManager but still has not updated the screen. I assume that there is a point where the systemManager or stage or some other item could say it drew the image.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
<s:layout>

[code]....

View 1 Replies

ActionScript 3.0 :: Object Copying

Mar 12, 2007

I have an object, which I would like to copy into a new object. This new object would not be a pointer to the new object. I need it to be totally independent, yet identical to the first object. Example

[Code]...

View 7 Replies

AS3 :: Flash - Copying A Loader From One Object To Another

Jul 20, 2010

I have two classes, call them A and B. They both contain a Loader object. In class A I load content into the Loader object.

public class A {
var loader:Loader;
public function A():void {

[Code].....

But that's not what I want. I don't want to manage a bunch of children when I know I only have one child but just want to change its content.

Is there a way to copy/assign a Loader directly? I tried assigning to 'content' but that's read-only. Basically I have an array of Loader objects that all get loaded with images. I then have a single Loader that's on the stage and I want to assign to it images (Loaders) from my array.

View 3 Replies

ActionScript 3.0 :: PNG Transparency And Object Under That

May 30, 2010

URL..they rocky frame you see is a PNG and it's converted in MovieClip to be able to change it's index so it's always in front of the other objects.Problem: once I get what I want (MC+png is in front of everything) I'm not able to interact with anything under the MC anymore.I know the problem it's that the png extends for all the MC space but I really need to make those object under the frame interactable.

View 2 Replies

ActionScript 3.0 :: Copying Loader Data To Make New Object?

Apr 26, 2011

I'm making a card game and each card has a certain symbol on it which is loaded from an external .png file. I don't want to make it so that it has to load the .png every time it make a card, so I made it load in the preloader/background. How do I make new objects that looks the same as the loader, like copying the loader's data or something?

View 1 Replies

Actionscript 3 :: Copying The Object And Then Mapping The Changes To It When A User Confirms They Want To Save?

Sep 2, 2011

When a user selects a record in a datagrid I launch a pop-up window with more detailed info. The user can make changes to the record in this window but they don't have to save them. For example, they can click the X to close the window.whenever a user makes changes I update the object directly.Is there a pattern for copying the object and then mapping the changes to it when a user confirms they want to save?

View 1 Replies

ActionScript 3.0 :: Copying Matrix Rotation From Larger To Smaller Object

Aug 18, 2011

Background: Sorry for the complex title, but can't think of a better way to describe this. So I have an image which is constantly moving and rotating (using matrix rotation around a specific point) on the stage. Problem: So I'm looking for a way that, when the user presses a button, a smaller image (exactly the same as the original one, only 3 times smaller) to position itself so that the smaller image's location is proportional to the the larger one's location. This means that the exact point of the larger image where it is rotating should be the corresponding part of the smaller image, thereby causing a kind of zoom out effect.

The truth is, I'm finding it even difficult to match just the x and y positions so they correspond, ignoring rotation, assuming the position is relative to the rotation point. Even this would be useful.

View 5 Replies

Flash :: Change Transparency Of A Movieclip Object

Mar 28, 2010

i've a MovieClip and i would like to change the transparency of this movieclip how can i do?

View 1 Replies

Actionscript 3 :: Clone An Object Including Copying The Event Handlers/listeners?

Apr 15, 2010

I want to clone an object of a class (whose source code I do not have) and copy all of the associated event handlers from the original object to the new cloned object. Does anyone know how I can do that? I know how to copy the properties from the original to the new, but can I iterate over all the event handlers and add them to the new object?

View 1 Replies

ActionScript 3.0 :: Memcpy Function Ala C / C++ - Copying Aspect Of Saving One Multi Value 'object' To Another

Jan 13, 2010

I've been working on some project and have been constantly frustrated at the pointer copying aspect of saving one multi value 'object' to another. I'm getting error: 1051: Return value must be undefined when I try to execute memcpy as: myArrayA = new memcpy(myArrayB); That is when it throws the error.

[Code]....

View 3 Replies

ActionScript 3.0 :: Remove A Displayable Link On The Linkbar Only?

Sep 30, 2009

I have a basic linkbar using a viewstack. For every entry into the viewstack an reference shows up on the linkbar. How do I remove the reference on the linkbar but still have access to the viewstack item?

View 0 Replies

ActionScript 3.0 :: Resize A BitmapData Object Maintaining Transparency Straight From LoaderInfo?

Jul 14, 2009

How to resize a BitmapData ?I've got this right after loading an image:var bitmapdata1:BitmapData = Bitmap(_bitmaploader.contentLoaderInfo.content).bi tmapData;I want to create a new BitmapData called "temp": var temp:BitmapData = new BitmapData(_custom_resize_width, _custom_resize_height);which should become a resized version of the " bitmapdata1 "how do I do that ?my attempt worked but produced white background:

var mat:Matrix = new Matrix();
mat.scale(_custom_resize_width / bitmapdata1.width, _custom_resize_height / bitmapdata1.height);

[code].....

View 4 Replies

Transparency - Add Wmode="transparent" For Every Flash Object And Embed Tag?

Apr 24, 2010

I have a page which displays dynamic flash content from issuu.com. I need to add wmode="transparent" because otherwise navigation menu shows under flash. Is there a short way to do this with jQuery or simple java-script?I don't want to change embed code every time a flash is added.

View 4 Replies

Copying And Pasting Motion Only?

May 30, 2009

i am happy with it and now want to repeat it with all the other images in the slideshowhe problem is, when i copy the keyframes (with a tween) on the first image that animated and try and paste them onto the 2nd image in my series, it actualy charges the image as well ! So that the second image becomes the firts image on the keyframes.Is there a way just to copy the opacity and motion animation ONLY ? My guess is there must be because to animate each picture by hand with a custom ease in & out curve would take forvever

View 1 Replies

Copying Text And Editing?

Mar 24, 2010

I want to copy some text to edit in the same style and size etc, however when I do change the wording, it changes the original too. How can I do this so only the copy changes when editing?

View 7 Replies

Copying Buttons From One File To The Next?

Jul 12, 2009

I don't come to you guys for help until I have completely exhausted my other on-line sources. I want to copy my buttons and their functions from one file to the next with out having to recreate it each time.

View 1 Replies

ActionScript 2.0 :: Arrays Keep Copying Each Other

Jun 18, 2004

This is probably something really simple but I have this multi-dimensional array which holds vital data. At one point in my program I need to copy the array so that I can sort it numerically and display the data, without permanently altering the original array order. I thought okay, create a new array and copy the original array data into it.[code]...

View 7 Replies

ActionScript 2.0 :: CS3 Copying Info To Webpages?

Aug 15, 2009

Im working on an application for a website. When the user finishes entering all of the information into the Flass application, they press a button. I want it to open another page from that website and enter the information into it.

View 3 Replies

Copying MovieClip And Changing Properties

Dec 11, 2009

I have a movie clip with a graphic. I want to copy the clip and change its colour. How do I create a copy of the movie clip change its properties without the other movieclip's properties changing as well. I have it now. I was copying the instance not the graphics themselves.

View 1 Replies

ActionScript 2.0 :: Copying The Value Of One Text Field To Another?

Feb 22, 2011

I have a text field with a variable name of "name" I have a second text field with a variable name of "name2"I have a buttonWhen the button is pressed, I simply want the text that the user has entered in "name" to appear in the "name2" text field.What action do I need to add to the button?

View 7 Replies

Copying Frames Sometimes Mixes Up Art Work?

Aug 20, 2009

I'm sure Adobe is sick of hearing about bugs, but.... one issue that I've noticed with Flash CS4 that was never an issue in CS3 is that when selecting the frames of a complex animation, copying them, and pasting them into another Flash file, often results in some of the artwork getting mixed up.

View 8 Replies

Copying Actions To A Duplicated Symbol?

Oct 2, 2009

I am an newbie trying to take an existing Flash game and modifying it for my own selfish goals.  I am duplicating symbols and trying to preserve all of their actions so that I can then swap them out for my own symbols.  When I swap, actions are preserved, but I have run out of symbols to swap, so now I am trying to duplicate the remaining symbol so I have more to swap with, but when I duplicate the actions are lost.  I have adjusted the actions code to accommodate more symbols ( or at least I think I have)

View 8 Replies

Professional :: Copying Layers From A Flash To Another?

Jan 28, 2010

I have two flash files, the one Im editing and the original. I want to copy two perfect layers from the original and past them on the one im editing, but each time I copy, it only copies the image, cant copy the entire layer with the animation.

View 1 Replies

Professional :: Copying Layers From One Movie To Another?

Apr 8, 2010

so I am trying to move the contents of my Flash movie to another, I want to keep thier file structures and tweens. I can keep the file structure but when i move the layer to a new movie clip or file, the tweens are shifted from their original place. how can i move them but keep their coordinates as well.

View 1 Replies

Professional :: Copying Symbols From One Library To Another?

Dec 19, 2010

I have an .fla I created a while ago. In it is a movie clip in my library which I now want to use in a new .fla. This movie clip is reliant however on an image which is also in the library. I have tried selected both the image and movie clip, copy them, and paste them into my new library, but this doesnt work. I have tried cutting... I have tried duplicating and copying the duplicate. Nothing seems to work. Is there anyway of getting a symbol from one library into another?

View 3 Replies

Professional :: Flash And Using Copying/pasting?

Dec 1, 2011

I have Flash installed under Vista 32bit.I am using a Flash based graphics package that will not copy to or paste from the clipboard.Latest Flash is installed.

View 1 Replies

Flex :: Copying An Instance Of A Class?

Dec 7, 2010

ObjectUtil.copy is a good technique for copying Objects. But after having a lot of problems using it to copy other classes, I guess it is not the solution I'm after.How would you approach the copying/cloning of instances of a class that you've defined? Maybe defining a function withing the class to copy it?It is cool that most variables are passed by reference in flex, but sometimes is annoying not having control over this (sorry, I'm too used to plain C).

UPDATE: I can't make the ObjectUtil.copy() work with a custom class is... is there a way to copy, by using serialization, a custom class? Did you use successfully a ByteArray copy with a custom class?

View 3 Replies

ActionScript 2.0 :: Bitmap CopyPixels Not Copying?

Oct 1, 2009

I am playing around with an old Zelda: Link's Awakening tile set, and was trying to make an application that will display the current selected tile.

I am well versed in as2 but have never had need for the bitmap classes until now. I have found examples of the copyPixel() function that work but could not get it to work in my code.

I have attached the .fla file I saved it as a CS2 (Flash 8) file. (I use CS3 and/or CS4 depending on which computer that I am currently using. This one is in CS3)

ActionScript Code:
// -----
// ----- Author: Nathan Sepulveda
// ----- Date:   Oct 1, 2009

[Code]....

View 6 Replies

ActionScript 3.0 :: Copying Arrays Back And Forth?

Jul 20, 2010

I am working on a program with a number of particles that fly around and can collide with each other.I keep all of them in an Array named "particleArray" However, when a collision occurs, I want the two colliding objects to be deleted, and 1 new one formed in their place. I can't do this with just one Array because it affects the order/length of the Array while it's still running through a for loop.

i'll just create a temporary array, make that a copy of the master array, make the changes I need to that one, and then when the master array isn't being used, I can copy the contents of the temp array back into it to be used for the next frame.However, flash doesn't seem to like this. I've tried splice/slice/and concat and get various errors. All the tutorials for copying arrays involve creating a new array and setting it equal, but I need both arrays to be persistent and global, only created once. Do I have to create a for loop to manually copy between the two?

flash hates this code, that I thought would be simple and work:

particleArray = particleArrayRefresh.splice(0); // empty the temp array into the main one.

All similar things i've tried have failed as well. It doesn't seem to want to set an EXISTING array in this way, but I really don't want to use an innefficient for loop to tax each computation cycle more.

View 4 Replies







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