Transparent file not working in Flash/AS3, though works in html

Hello:
I have a .gif image with index transparency, which shows up
as I'd expect (i.e. with correct transparency) when incorporated
into a web page. However, the transparency does NOT show up in my
Flash swf. In ActionScript, I am using the Loader to load the
image, and the Bitmapdata that comes from this DOES have the
transparent property set to TRUE (I can see this in the debugger).
However, the transparency doesn't work. Thanks for any advice!

I realized what I was doing wrong. I wasn't calling
new BitmapData
with the transparency parameter and fillColor parameters.
Sorry to take up room on the board with something that should have
been obvious!

Similar Messages

  • Creating a file on server, using Flash AS3 + PHP

    I have a very simple PHP script that creates a new file on my server using a random number for the file name (e.g., 412561.txt).  When I load the script directly from a browser, it works.  But when I load the script from a very simple Flash (AS3) script, it does not work (i.e., doesn't create a file).  The Flash script and PHP script are both in the same directory.  Permissions on the directory and its content are 755.  Temporarily setting those permissions to 777 does not solve the problem (i.e., PHP still doesn't create file when called via Flash).
    Here is my phpinfo.
    Here is the PHP file.
    The contents of the PHP file are:
    <?php
    error_reporting(E_ALL);
    ini_set("display_errors", 1);
    $RandomNumber = rand(1,1000000);
    $filename = "$RandomNumber" . ".txt";
    $filecontent = "This is the content of the file.";
    if(file_exists($filename))
              {$myTextFileHandler = fopen($filename,"r+"); }
    else
              {$myTextFileHandler = fopen($filename,"w"); }
    if($myTextFileHandler)
              {$writeInTxtFile = @fwrite($myTextFileHandler,"$filecontent");}     
    fclose($myTextFileHandler);   
    ?>
    Here is the html container for the Flash script.  The Flash script features a single button which calls the PHP script when pressed.  In case it helps, here is the raw Flash file itself.  The code of the Flash script is as follows:
    stop();
    var varLoader:URLLoader = new URLLoader;
    var varURL:URLRequest = new URLRequest("http://www.jasonfinley.com/research/testing/TestingSaveData.php");
    btnSave.addEventListener(MouseEvent.CLICK,fxnSave);
    function fxnSave(event:MouseEvent):void{
              btnSave.enabled=false;
              varLoader.load(varURL);
    Directory listing is enabled at the parent directory here, so you can see there when a new text file is created or not.  (Um, if this is a security disaster, please let me know!)
    Can anyone please help me understand why this isn't working and how I can fix it?  Thank you
    ~jason

    #1, Yes that is a security risk, please disable directory index viewing.
    #2, Always validate. I see no issue with the code you're using but clearly it's not working. The way you find out is your trusty errors.
    Make a new document (or paste this into your existing) where a button with the instance name btnSave is on screen:
    // import required libs
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.MouseEvent;
    import flash.events.SecurityErrorEvent;
    import flash.text.TextField;
    // assign handler
    btnSave.addEventListener(MouseEvent.CLICK, fxnSave);
    // make a textfield to display status
    var tf:TextField = new TextField();
    addChild(tf);
    tf.width = stage.stageWidth;
    tf.height = 300;
    tf.multiline = true;
    tf.wordWrap = true;
    tf.selectable = false;
    tf.text = "Loading...\n";
    // just making sure the textfield is below the button
    this.swapChildren(tf,btnSave);
    function fxnSave(event:MouseEvent):void
        // disable button
        event.currentTarget.enabled = false;
        // new loader
        var varLoader:URLLoader = new URLLoader();
        // listen for load success
        varLoader.addEventListener(Event.COMPLETE, _onCompleteHandler);
        // listen for general errors
        varLoader.addEventListener(IOErrorEvent.IO_ERROR, _onErrorHandler);
        // listen for security / cross-domain errors
        varLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, _onErrorHandler);
        // perform load
        varLoader.load(new URLRequest("http://www.jasonfinley.com/research/testing/TestingSaveData.php"));
    // complete handler
    function _onCompleteHandler(e:Event):void
        tf.appendText("Load complete: " + e);
    // error handler
    function _onErrorHandler(e:Event)
        if (e.type == SecurityErrorEvent.SECURITY_ERROR)
            tf.appendText("Load failed, Security error: " + e + " type[" + e.type + "]");
        else if (e.type == IOErrorEvent.IO_ERROR)
            tf.appendText("Load failed, IO error: " + e + " type[" + e.type + "]");
    I get a Event.COMPLETE for mine, so the PHP script is definitely firing. Change the URL to something invalid and you'll see the IOErrorEvent fire off right away.
    That leaves you to diagnose the PHP script. Check your error_log and see what is going wrong. You're suppressing errors on your file write which doesn't help you locate the issue saving the file. If you want to handle errors yourself you should do the usual try/catch and handle the error yourself (write a debug log file, anything).

  • SCA Files not visible in checkin tab though present in inbox folder

    Hi All,
    I trying to move the Components from development to Quality and production systems.I have Created my SC added dependency files (SAP-JEE, SAP_BUILDT, SAP_JTECHS) and PCUI_GP SCA , BP_ERP4HRE SCA file. Last SCA file is the business package HR Executive and analytics.
    I have created the Domain, updated the CMS, Created track with the SC,gave the details in Runtime system.Now in Transport studio in the checkin tab i gave the check-in configuration path correctly as "/usr/sap/JTrans/CMS/inbox" and now when i check in i can see all the files except the business package SCA File -BP_ERP4HRE.We crossed check whether all files are available in the inbox folder and we found all files there solid.
    Can anybody help me out in this scenario, I have searched the forum but i was not able to find solid solution ... Has anybody worked in this Business package transport before and faced similar problems ?
    I would certainly appreciate helpful answers, so do put in your valid points as soon as possible since the job is quite urgent.
    Thanks and regards,
    Vivek

    Please recheck the version of your SCA file.
    The UI filters and shows only compatible SCA versions.
    Best regards,
    Bhuwan

  • SWF file not playing in flash player

    Hello All
    I am working on this project for a client, suddenly no-one can get the SWF file to play.
    https://drive.google.com/folderview?id=0ByWDl-PaRWIFY0c1SnEwbUNraUE&usp=sharing
    The file is there.
    If anyone can help please do.
    I know this file works. It must be an update or something?
    Please Please Help

    If you've lost the source to your SWF files, there are a number of SWF decompilers available.  You may be able to decompile the SWF and then recompile the project using a current compiler.  It's worth a shot anyway.
    A cursory Google search turned up a few candidates (free and paid), but I don't have much experience with any of them. 
    http://www.sothink.com/product/flashdecompiler/
    http://www.free-decompiler.com/flash/
    http://www.swf-decompiler.org/
    SWFWire - Flash developer tools
    FWIW, I've never seen that blue screen and circle behavior before.

  • [AIR] File Not Found in MAC OS but Works in Windows

    Hi All
    I have an htmlFolder in my "src" which contains html files. What I do is, that at runtime i render the html File in <mx:HTML id="htmlView"> using the following code.
    htmlView.location = "app:/htmlFolder/sub-folder/fileName.html";
    Problem ->
    This works fine in windows, but does not work in MAC OS. Probably because windows uses folder structure, not sure about MAC OS, but i guess it installs as a single file containing sub-folders hidden from user. Does anyone knows a solution to it?
    Thanks and Regards,
    Ahmed.

    Thanks Atif and Barna Biro... thats what I am already doing
    var file:File = new File(File.applicationDirectory.nativePath + "htmlFolder/sub-folder/fileName.html");
    htmlView.location = file.nativePath;
    and have also tried the following, as mentioned by Atif
    var file:File = File.applicationDirectory.resolvePath("htmlFolder/sub-folder/fileName.html");
    htmlView.location = file.nativePath;
    but what I have noticed is that it actually finds out the file.. because there is another file, a db file, which does not need to be rendered on html, is picked u perfectly, is updated, and everything can be done to it.
    So the problem is rendering of HTML
    in mac............... how do we render local html files ??? Why local.. because i was able to open up youtube.com

  • Why do .mp4 files not show up in the Finder/work in iDVD?

    Hi
    I downloaded some .mp4 files from the internet on my Windows PC and as per usual they are played by quicktime on my PC.
    When I saved them to my external HDD and plugged it into my MBP, the folder containing the mp4 files does not appear, and neither will they import into iDVD where I am trying to burn them.
    I am a new MBP user (and a happy one so far) so I am well aware I coukd be missing something here, but I thought that .mp4 was practically guaranteed to play on a Mac especially given the relationship to video iPods?
    Thanks in advance for your contributions!
    Macbook Pro   Mac OS X (10.4.6)  

    Thanks, but after installing this nothing seems to have changed except that if I download the .mp4 files from my Mac they appear on the Desktop. They can be played with Quicktime but if they are played in VLC there is no sound
    The folder on my external HDD which contains the .mp4 files still does not ahow up.
    I am now very confused!
    Does anyone have more ideas, I'll try whatever!
    Thanks

  • Using FF 3.6.13, it cannot open an Adope PDF ( says file not found) while all other browsers work!!!!

    I have updated FF and Adobe Reader and its plugin to the latest levels.
    This error happens on several PC's of friends as well so it is a serious issue. Chrome, IE and others have no problems at all when executing the same thing on the same PC.

    The above instruction set for opening PDFs within Firefox DID in fact work.
    Thanks!
    It does open it in a separate window from FF but at least it works. ( yes, I tried the options to stop that no luck)

  • GetURL isn't working when flash button is embedded into HTML

    I'm making a basic HTML site with flash buttons that direct to hyperlinks.
    I've made a simple flash button with the code on the button actions as:
    on (release) {
            getURL("http://www.google.com","_blank");
    The button works great when I export it in Flash.
    When i embed into the HTML using dreamweaver and preview/upload the site.... the button is there but when clicked it doesn't direct to the hyperlink.
    ANy ideas? Thanks. Brendan.

    Use Flash to generate an html page and test that on the server.  If that works, then replace whatever Dreamweaver did with the Flash-made embedding code.  Beyond that, a link to the file on the server could shed some light.

  • Since installing firefox4.0b5 sound has stopped working with flash. Still works normally with 3.6.x and was working with 4.0b1

    Yesterday I downloaded the latest nightly build of minefield and flash stopped working. I re-installed flash, still now joy. I copied all plugins from usr/lib64/plugins to .plugins and videos then played in flash but without sound. Sound continues to work normally in Firefox3.6.x and in Opera. Distribution is Mandriva2010 Spring

    Strange, it is now working again, I can't think of anything I have changed. - I uninstalled nspluginwrapper and re-installed it, re-booted and that didn't seem to make any difference but just clicked on a video and it played fine with sound. Really annoying because I don't know what to do next time if it happens again.

  • Loader.close doesn't work in Flash but does work in Flash player

    When testing a movie in flash with simulate download the
    Loader.close() function doesn't seem to work when trying to cancel
    a load but it does work in a browser! You'll need to try to load a
    movie that has sound. The loader looks as if it stops but then the
    sound that's in the loaded movie will play, proving it hasn't
    stopped loading
    add a button with instance name btnCancel

    See this cool mp3 xml player with visualization, playlist and
    skins. Fully customisable. Vector.
    http://flashden.net/item/mp3-xml-strongplayerstrong-with-visualization-and-skins-vectorise d/11851

  • Using box2d flash as3 engine for iphone apps

    Hi
    have any body tried box2d flash as3 libraries working with flsh cs5 iphone apps.? when i compile app it give many errors, using flash player 9 give one error b2fixture undefined type error. any body developing physics base games as3 for iphone please share any good as3 physics base game engine.
    Thanks

    If you are targeting all iDevices I strongly suggest to forget about the Box2D. There is absolutely no way you can get (almost) any kind of physics simulation running smoothly with 1st and 2nd generation iDevices with current version of Packager for iPhone.
    And it really is graphics that is the problem more than anything else. Forget about caching Sprites or MovieClips. Actually don't use MovieClips and Sprites at all, it's just too slow. Instead start extending Bitmap class with your own animation system (swapping BitmapData) and mouse handling (hitTestPoint), there's plenty of examples.
    And then if you write really really optimized code you can get one fluently moving and animated sprite object running on your iPhone or iPhone 3G (with out doing anything else than just moving and animating that one object). More than one (animated and/or moving) object causes serious performance problems. You don't notice this as linear slowing in FPS (which would still be kind of ok), but it's more like skipping frames every now and then. This looks and feels really disturbing and makes designing of games pretty hard...Using GPU mode doesn't make any difference.
    But to answer the question, I'm pretty convinced that you can get (simple) Box2D simulation running smoothly on iPhone if you:
    1. Target only 3rd generation iDevices and above
    2. Use only Bitmaps as graphics
    3. Do rotations with pre-rendered frames (or don't use rotation at all)
    4. Optimize Box2D and your code thoroughly
    Just for **** and giggles I think I try to get some kind of physics simulation running on 3G too...
    By the way, comparing performance of 1st generation iPhone to HTC Desire (I happen to own both too) is like comparing C-64 to my shiny new Phenom II X6 rig. If you just look at the specs:
    HTC Desire:
    1 GH ARM v7
    AMD Z430 GPU
    576 Mb DRAM
    iPhone 3G:
    ARM 1176JZ(F)-S (underclocked to 412 MHz)
    PowerVR MBX Lite 3D
    128 Mb DRAM

  • I just used stellar phoenix mac data recovery and it seemed to work but now my files won't open.  Even though they are "jpeg, mov" files the error message is  could not be opened. The movie's file format isn't recognized. "  Any help or are they corrupted

    I just used stellar phoenix mac data recovery and it seemed to work but now my files won't open.  Even though they are "jpeg, mov" files, the error message is  "could not be opened". The movie's file format isn't recognized. "  Any help or are they corrupted?

    Sounds to me like the file is probably corrupt. If you had hard drive corruption or damage, that could easily result in recovered files not being fully intact. If you were trying to recover accidentally deleted files, it's possible they might have been partially overwritten before recovering. There are never any guarantees with file recovery.
    Without more information on the circumstances that led you to try recovery, it's hard to give advice on what to try from here. You could always try another file recovery tool, like Data Rescue 3. Just be sure you're taking appropriate precautions when doing recovery. See Recovering deleted files.

  • Flash File not working with DW

    "Content on this page requires a newer version of Adobe Flash Player"
    I know others have had this same issue, but after researching and trying everything, I am just not able to fix it.  Anyone out there have any ideas?  I have a website created in flash.  I used DW to import the flash file and upload to the server.  Very simple html page with nothing else but the flash file.
    Here is the website. www.meghanmcmehon.com.  Just need some help here.  Thx.

    Source code indicates that the page is still pointing to a local file for the flash content,
    <param name="movie" value="file:///Macintosh HD/Projects/Matrix Entertainment/Christopher Zurek/3422ZRK Media Files/Site/root.swf" />
    so by default it displays the "get flash" prompt.
    You need to change the all of the reference(s) to point to a file in the root folder, and re-put the page. This includes your javascript ref in the header:
    <script src="Macintosh HD:Projects:McMahon, Meghan:3481MCM Profile:3481MCM Media Files:Site:Scripts:swfobject_modified.js" type="text/javascript"></script>
    Also, you should only work in lower case wherever possible (naming files), to avoid mistakes in file references.

  • Flash 13.0.0.214 does NOT work on some sites, but works fine on all others

    Hi!
    I watch several wildlife nest-cams every day running Windows 8 using Firefox 29.0.1, but yesterday morning, (after I'd already watched the 6 cams I view every day), I started getting a solid, black screen with, "Error loading plugin: Plugin file not found", on TWO of these sites.
    My attempts to resolve the problem were:
    1.  Checked all the other web-cam sites I view daily, and there's only a problem on 2 of them.
    2.  Went to You Tube, Facebook & other similar sites and I can view streaming media.
    3.  Refreshed pages-when that didn't help, I closed & reopened Firefox & still 2 sites with "plugin loading error"
    4.  Completely shut-down my laptop & rebooted.
    5.  Did "System Restore" to earlier in the day when ALL web-cam sites were working.
    6.  Went to Adobe Flash site & verified that I had the most current version...I do, & I saw the animations on Flash site.
    7.  Verified my Flash Plugins in Firefox...AGAIN...they're all activated & up-to-date
    8.  Checked & re-checked ALL the web-cam sites I view every day, (for, at least the 10th time), and the
         same 2 sites are still showing the "Error loading plugin: Plugin file not found" on a black screen.  Even
         though the video isn't seen the "chat" area is functioning, (I don't know if that's important, but I
         thought I should mention it).
    9.  I posted the issue on Firefox's Forum but no one has an answer since Flash works everywhere except
         for 2 sites.
    I've tried everything I can think of to troubleshoot this, but as you can see, I've had no success in solving this "mystery".
    As for the 2 sites I can't view, they are: 
                                        http://www.pixcontroller.com/eagles/    And
                                        http://www.westmorelandconservancy.org/BlueBirdWebcam-1.htm
    I've been watching these sites for MONTHS, so why I can't view them all of a sudden, well, I'm clueless, (I guess you already figured that out...ha ha ha).  I was watching the 2 sites listed above early yesterday morning, then when I looked at one of the other cams I view and came back to these 2 sites, I got the "error message".
    I hope you have a solution for me, as I'm desperate!  I'm WAY behind in my documentation for these 2 sites, so hopefully you'll have an easy answer.  If it's a technical thing, please use LOTS of details, as I'm not very technically inclined.
    Thanks in advance for your help!
    Best Regards,
    DogPal 
    P.S.  I just checked on another site that offers many different wildlife cams, & I CAN view the "Pittsburgh Bald Eagles" if I go through: http://www.ustream.tv/channel/pittsburgh-bald-eagles    I'm sure this means something, but since I don't understand this technical stuff I don't know what that is!  (I told you I'm clueless!) 
    Message was edited by: Donna ....I had additional information

    First, thank you for a very good and detailed description of your problem; so few people provide any information when asking for help.
    Trying to reproduce; the first of your links works fine on Firefox, PaleMoon, and Internet Explorer.
    The second link only shows a blue screen after the ad (on the same three browsers)
    What is your installed Flash Player version?  See Flash Player Help | Flash Player Help
    Can you also try on a different browser such as Internet Explorer?

  • Works in Flash player but not from Browser

    I know this has shown up in the forum before but I must be using the wrong search terms because I can't find it.
    I've created a Flash file that reads from several different xml files and displays them when requested. When I run the Flash player, (by pressing Command-Space within Flash), it all works flawlessly. But when I open it within a browser, only one of the xml files loads, the other two just spin away on the preloader.
    I have another Flash file that is doing the same thing. A click on a scrolling new list should take you to another web page. In Flash Player it works fine, but from a Browser nothing happens.
    Anyone know why this is?
    thanks

    As odd as it may seem, the tip-off to the problem may be:
    " When I run the Flash player, (by pressing Command-Space within Flash), it all works flawlessly"
    If any of your Flash assets are in a different folder than the HTML Web page... then testing the .swf directly like that should NOT work!
    It's most likely a pathing issue:
    Pathing issues
    Almost always when it works on the local machine and not the server, it's a pathing problem.
    You can put your Flash related files in whatever folders you want, they do NOT have to be in the root, they do NOT all have to be in the same folder. But if you have a problem and if sticking them all in the root folder works, then you know that the issue was a pathing problem.
    Just remember that paths used in the .swf become relative to the Web page on which the .swf is placed, NOT it’s physical location.  So for example, if your .swf is in the flash/data folder and you use that .swf on a Web page in the root folder, you are in effect, removing that .swf from flash/data and putting it in root. So if the .swf is loading any related files (xml, images, video, etc), the path used inside the .swf to load the .xml file has to be relative to it's new location in root and then back down into flash/data. This is true even though when testing the .swf by itself, it can be inside flash/data and work just fine, since relative to it's location, the path is just fine, they are in the same folder. But if that same path is used when the .swf is placed on a page two folder levels up, the relative path has changed, the old "same folder" path will not work.
    In fact if you are placing the .swf on a web page in a different folder than the .swf is stored in, and that .swf calls external assets, then direct clicking and opening of the .swf in it’s folder should NOT work! That’s because the paths to the external assets should be relative to the Web page and not the physical location of the .swf.
    So just be sure that you use addresses relative to the final Web page locations (not physical file locations) and you can put the Flash related files in what ever folders you want.
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com
    Best wishes,
    Adninjastrator

Maybe you are looking for