Loading external png with transparency

Hello

Im trying to create a system of navigation with a few buttons as3.0.

Each button is a png image.

When the import of images to the stage im I don't have problems of transparency, but the problem is that they are enough, not smooth not especially

because im animating the using TweenLite.

I thought that the only way to do this correctly is to load all images using as3 in bitmap objects and then use the smoothing property.

The problem is that whenever I attribute the png to a bitmap object, I lose the transparency of information and get a white background...

Anyone know how I can keep transparency information of png on the bitmap object?

Thank you

Here is a little code that loads a PNG with transparency, it softens and placed on stage.

var a: Loader = new Loader();
a.Load (new URLRequest ("spider.png"));
a.contentLoaderInfo.addEventListener (Event.COMPLETE, done);

function done (e: Event) {}
var bit: image Bitmap = e.target.content;
If (bit! = null) {}
bit. Smoothing = true;
}
addChild (bit);
}

Tags: Adobe Animate

Similar Questions

  • Save in TIFF or PNG with transparent background

    PS cc (2015.5.0) create an image with multiple layers, all with transparent when I try to save as TIFF or PNG so I can move to the WEB Site, the file does not keep the background transparent. How can I solve this.

    For the WEB using the PNG.

    If all your layers are transparent,

    Save the png file, and then reopen the file in photoshop to check if it is registered with transparent background.

  • Unable to save in PNG with transparent background?

    I try to save a file in PNG format with transparent background, but PNG is not an option on my save as a list. In the following video the instructor made guess I can't?

    http://www.YouTube.com/watch?v=XKZ-IARmhsg

    Choose Image - Mode.

    To save an image PNG, if it's not RGB, 8-bit/channel, make sure.

    Note what is shown in the title bar or the tab of the document on the instructor machine - RGB / 8.

    -Christmas

  • Strange behavior of the PNG with transparent background

    Hi all

    I am facing a strange problem on a request of my friends that I'm upgrading. The application is written in CVI2009SP1 and is already running on the customer's site. I am now adding several new features and made some changes in the application file UIR and all of a sudden all the images I have show a black background instead of transparency.

    The strange thing is that I see the images correctly in the editor of the UIR, the black background being shown only at runtime, no matter if debug or release.

    It is an example of wat I see:

    I tried to reload the image in control after checking transparency but the situation has not changed. The problem is that the images in. The other images, PNG format in. Format ICO show properly.

    I see this behavior in my office on both two machines wirth 2009SP1 for 2012SP1 development and execution. The same phenomenon occurs on the client PC runtime 2010SP1 and no IDE installed. If I run the original application with the UIR unmodified, transparency is properly managed. I'm not operated by program images, which are only decorative elements on the user interface.

    What can happen?


  • Save in PNG with transparency

    I'm trying to save a file in Photoshop, change the width and the height of 50%, the resolution to 300 and keep transparency. If I save in .png, it flattens the layers.

    Save as 'Save for Web' works, but for some reason, it changes the resolution to 72 and a width of 37 inches. If I open the image in Photoshop and change the resolution to 300, I get good 8.88 in. width.

    Here's what I have in the script. I'm new to javascript so patient with me.

    var xMaxFullDimension is activeDocument.width.as ('in');.
    var yMaxFullDimension is activeDocument.height.as ('in');.
    activeDocument.resizeImage (new UnitValue(xMaxFullDimension*50/100,'in'), new UnitValue(yMaxFullDimension*50/100,'in'), 300, ResampleMethod.BICUBIC);

    sfwPNG24(saveFile,100);

    function sfwPNG24 (saveFile, quality) {}

    var pngOpts = new ExportOptionsSaveForWeb;

    pngOpts.format = SaveDocumentType.PNG;

    pngOpts.PNG8 = false;

    pngOpts.transparency = true;

    pngOpts.interlaced = false;

    pngOpts.resolution = 300;

    pngOpts.quality = quality;

    activeDocument.exportDocument (new File (saveFile), ExportType.SAVEFORWEB, pngOpts);

    }

    You can simply use a normal backup rather save for web to keep the 300 dpi. You can use scriptlistener to record all the code.

  • Loading external Table with quotes

    I have a file with fields in the file are as TAB delimiter ~ TAB.

    Example as below:

    QM ~ CD ~ Exzm ~ BMW

    DM ~ BD ~ Exzm ~ BMW

    CREATE TABLE test

    (

    Col_1 VARCHAR2 (100),

    Col_2 VARCHAR2 (100),

    Col_3 VARCHAR2 (100),

    Col_4 VARCHAR2 (100)

    )

    EXTERNAL ORGANIZATION

    (TYPE ORACLE_LOADER

    DEFAULT DIRECTORY 'Test_Report '.

    ACCESS SETTINGS

    (records delimited by '\n'

    CHARACTERSET 'UTF8 '.

    fields terminated by '\t~\t '.

    missing field values are null

    )

    LOCATION ("test.asc")

    )

    REJECT LIMIT UNLIMITED;

    OUTPUT:

    ----------------

    Data loaded in DB, but col_4 data comes from the quotation as below

    col_4

    -------

    "BMW".

    "BMW".

    Note: Col1 - col3 data arrives correctly.

    2807064 wrote:

    A finding on my side.

    I found that the values of Col_4 after inserting into DB with "transport return character" (CHR (13)) at the end of each value as shown below when I copy paste the value in notepad ++ "»

    Example:

    ----------

    "BMW".

    "

    But if I see the file I saw that BMW.

    My question is, in this case the external table loading must fail right? Why is this it is to load data in DB?

    Do you have this file begin life on windows, and then are transferred to * nix to serve an external table?  If so, which explains a lot.  Windows is the standard record delimiter x '0d0a' (Chr (13) 10)  On * nix, it's just x '0A' (10.  When the process of loader is scanning for record delimiter he's just looking for the '0A' x and x'd 0' gets included in the data.

    Two solutions-

    1 - Make sure that the data file is transferred so that the Records delimiters are converted.  It's supposed to to happen with ascii ftp mode, but this week I saw several examples in the House of it does not.

    2. attach your table definition external to seek the delimiter of actual recording instead of the default value of the operating system. == RECORDS DELIMITED BY X '0D0A '.

  • Try a background image with a PNG with transparency matte / partial transparency

    Hello everyone.

    Here's the scenario;

    1. I have a PNG sequence rendered in a 3d program. The sequence has a landscape that is partially transparent and has no background image or color. In the animation, which is not the landscape is 100% transparent, while the landscape is partially transparent.
    2. I have a background that I want to put behind the PNG sequence but I don't want the background visible through the part of the landscape of the sequence, only the portion that is 100% transparent.

    I tried several different methods, but because the landscape is partially transparent, with a matte (alpha or alpha reverse) or blend (such as stencil alpha) mode does not give me the results I'm looking for.

    I'm looking for is a way of mast (or mask) the background image with only the part of the PNG that is 100% transparent. In this way, the background image are not displayed in the semi transparent landscape, but will be visible in the part that is 100% transparent.

    I would like to find a reasonable solution in After Effects, as opposed to the sequence of 3d objects rendered being invisible to the camera and the current background. The landscape scene itself took a considerable amount of time to make (120 hours) and I would like to avoid this kind of delay in my project.

    Thank you all in advance for your consideration.

    Maybe I said incorrectly: you cannot use the 3D app to generate a matte black and white simple - or mattes - to separate properly, then just composite in AE?

  • How to load external png image via xml?

    Can someone help me with the addition of a png image to a mc with an instance name.

    I want only to display a single image (no Gallery)

    I would like to get the url of the image via an xml.

    Here's a copy of my current action script which has already pulled in xml data that includes the node with the url of the photo.

    import flash.events.Event;

    import flash.events.MouseEvent;

    import flash.net.URLLoader;

    import flash.net.URLRequest;

    var myXML:XML;

    var myLoader:URLLoader = new URLLoader();

    myLoader.load (new URLRequest ("links.xml"));

    myLoader.addEventListener (Event.COMPLETE, processXML);

    function processXML(e:Event):void

    {

    myXML = new XML (e.target.data);

    trace (myXML);

    menumv.carbtn.addEventListener (MouseEvent.CLICK, openCURL);

    menumv.edubtn.addEventListener (MouseEvent.CLICK, openEURL);

    menumv.psybtn.addEventListener (MouseEvent.CLICK, openPURL);

    menumv.stubtn.addEventListener (MouseEvent.CLICK, openSTURL);

    menumv.busbtn.addEventListener (MouseEvent.CLICK, openBURL);

    menumv.shabtn.addEventListener (MouseEvent.CLICK, openSURL);

    studentmv.stuname.Text = myXML.student.name;

    }

    function openCURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.car.url));

    }

    function openEURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.edu.url));

    }

    function openPURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.psy.url));

    }

    function openSTURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.stu.url));

    }

    function openBURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.bus.url));

    }

    function openSURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.sha.url));

    }

    And here's a copy of the node that contains the url

    <menu>
        <student>
        <name>testnamehere</name>
        <photo>http://10.0.0.2/test/photos/testnamephoto.jpg</photo>
        </student>
    </menu>
    

    I saw this tutorial but it was for a gallery, and I couldn't not to hack and slash to do what I want.

    http://Tuts.flashmint.com/creating-a-simple-XML-Gallery-in-ActionScript3/

    Thanks again in advance for any help.

    Check if this gives null if yes it would output menu.student.photo

    trace (Student.photo)

    var _request:URLRequest = new URLRequest (student.photo);

    var _ldr = new Loader();

    MC's movieclip where you add your image

    mc.addChild (_ldr);

    _ldr. Load (_REQUEST);

    _ldr.contentLoaderInfo.addEventListener (Event.COMPLETE, load_complete, false, 0, true);

    function load_complete (event): void

    {

    whatever it is may be melted in the image

    }

  • Loading external HTML with the overall context attributes

    I am using Google Finance to load a stock quote in a HTML window.

    In samples of mosaic 9.5 the uri of the tile is http://www.google.com/finance?client=ob & q = $ {application.symbol}. It does not load the iframe in my college project.

    In fact, I tried to configure my .cxml as

    http://www.Google.com/finance?client=ob & q = ADBE

    http://www.Google.com/finance?q=ADBE

    http://www.Google.com/finance

    but none of these URIs loads the iframe. The only uri that is loaded with success is

    http://www.Google.com

    What Miss me?

    Steve

    The example of brokerage in the example package for ES3 Concepts now

    uses a Web site to different finance due to a change in the Google finance site.

  • CC Moving Photoshop layers when exporting PNG with transparent background

    Hey, if someone could help that would be great.

    I make videos and use photoshop to create subtitles/text using the type tool, transparent background and then superimpose the image file into iMovie.

    However, sometimes photoshop decides to move the text, even if I do not have when exporting, only seems to happen if the background is transparent.

    For example. These two images and if you switch between them quickly enough to create a moving image.

    test2.pngtest1.png

    I think you'll find that the border of the images are not the same, because of the background is transparent. You can check by looking at the dimensions in pixels for both images. They should be the same.

  • I saved a PNG with transparent background...

    .. as a GIF and it shows that I can't delete or same color on a white background in Photoshop. All the ideas that I was wrong?

    Thank you.

    Just to be sure... did you have your backdrop the value transparent (showing the checkerboard)?

    You did record under or do you export? You export your .gif in the menu:
    "File > preview image ' (CS3) or" file > Export Preview "(earlier versions)
    and select the Alpha transparency.

  • Save the bitmap in PNG loses transparent

    I have a png image in a resource file with transparency.

    I had a few changes to the bitmap image and recorded on the sd card in the png format but

    the transparent color is black.

    How to save the image in png with transparent color? Thank you

    Although you'd have to do some research, there is a PNG encoder that someone (J. David Eisenberg) wrote and it supports alpha. I could not find it in a quick search.

  • How to save a PNG with an alpha right or fat?

    Long story short, work in broadcasting and a new piece of equipment like the png files.  I know how to save png with transparency, is not the problem.  I don't know how or if this is possible is to save with an alpha right or fat.  At the moment we feather or extend the edges to past the alpha to say a logo and save it as tif, psd, or .tga.  This way once it is indexed on video or something else, the edges look good, no bad black border... it is logical, explaining probably not very well.   But move to png files, I have no idea how to do an alpha right or fat because he sees the transparency.  I mean that if I have feathers on the edges, a png will see this right, since there is no alpha?

    I hope this makes sense?

    > If we don't fill the transparent areas and semi-transparent image with the colored part of the image, we have usually get a dirty key/matte or a lot of fringes.

    This means that your other software and hardware is not reading/interpretation of the PNG file correctly.

    PNG saves with everything that is in the pixels in the transparent area - because they are supposed to be transparent and not seen.

    If you see artifacts in the transparent areas, then something is wrong with the software displaying the PNG, because 100% transparent should not be visible at all.

    Almost, it looks like someone could not read the documentation and specifications and try to treat the PNG as premultiplied format.

  • Problem with loading external swf files

    Hello

    I am currently working on a project which is an interactive and dynamic elemtry school presentation to the Denmark. I finished my project and it works perfectly, but only locally on my computer.

    The final draft should be implemented on the site and public work. I tried to implement the project on the site and unfortunately, it does not work as expected.

    When all the files where transferred to the ftp server, only a single files are responding and appear correctly.

    Interactivity of the project is based on a structure of Action script, which is based on the smooth transition between swf files (load another swf file after the action is triggered by clicking on a button) do any work.

    After days of trying to figure out the solution, I'm totally lost. One thing is to publish the project so that all action script will work and answer between swf files, and the other thing is to make it user-friendly for the Android and apple products.

    The presentation is quite heavy because of its loading external swf content files, which are images and movies.

    I really hope you can help me with my problem. I will gladly share the files and codes if it would help solve the problem.

    Best regards

    Agata

    It could be a problem of location of file from loading.  When you place a swf file in an HTML base for targeting anything that the SWF load becomes the folder of the html page.  You may need to adjust the target so that the target of swf files, load it as if it were in the same folder as the html page.

  • load an external file with urlloader doesn't work in AIR

    Had some problems with the loading of an external xml file with urloader. Read somewhere to use

    file.applicationDirectory.resolvePath('examplefileURL.xml');

    -What is the normal way to load external xml files or indeed all files as SWFs etc... and what about mobile is that the only way?

    not exactly.

    1 applicationDirectory is a static property of the File class.

    2. you probably don't want to use applicationDirectory and

    3. you must use the file system class to load files from local file system:

    var file:File = File.applicationStorageDirectory.resolvePath ('examplefileURL.xml');

    var fs:FileSystem = new FileSystem();

    ISA Open (file, FileMode.READ);

    var XML = XML (fs.readUTFBytes (fs.bytesAvailable));

    ISA Close();

    trace (XML. ToXmlString());

Maybe you are looking for

  • "operating system not found '.

    When I turn on my laptop I see regularly "OS not found". I turn it off and try again and usually my computer starts correctly. It sometimes takes 2 or 3 attempts before it starts up.What is the cause and what can do? The model is HP G6060EA Notebook.

  • Hello, asking for ideas/help for high vi.

    Hello, excuse my rookieness lol.  Just, I acquired my CLAD certification and began to get wet feet. With all of your experience, I was wondering what you might think, this is the best way (read simpler) to create a vi that is a simple drop-down menu

  • key cluster / 1553 communication

    I communicate more 1553 condor pcmcia card. I have a framing sequence 3. frame 1, I'm the initialization of map of 1553. In the second frame, I have a great while with a smaller loop all looped inside it sending a chain drive from 1553 to my material

  • Boolean Array controlled clock reentrante Subvi

    I am in the final stage of implementation of my program. Currently, I have to overcome two obstacles. #1 corresponds to the attached VI "my chronometer. The round LED starts to count time and stops him. Problem is even if I turn it off it, the timer

  • Pavilion dv8225nr won't recognize/see SD card,

    As a first step, it would work if I restarted, then used at least very slowly open and see even though he cannot read. Now it does'nt see or give it a drive letter. Tried to use the card with the same results usb reader. Tried reloading the drivers o