Invalid BitmapData

hello there. I am trying to use the reflect class from "http://pixelfumes.blogspot.com/2007/03/reflection-class-v3-with-source.html" but I keep getting this error:
ArgumentError: Error #2015: Invalid BitmapData.
     at flash.display::BitmapData()
     at Reflect()
     at Site_fla::GalleryPage_29/loadThumbs()
     at Site_fla::GalleryPage_29/sortXML()
     at flash.events::EventDispatcher/dispatchEventFunction()
     at flash.events::EventDispatcher/dispatchEvent()
     at flash.net::URLLoader/onComplete()
here's how I'm using it:
function loadThumbs():void
     for (var i:uint = 0; i < myImages.length(); i++)
          thumbLoader = new Loader();
          thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
          thumbLoader.load(new URLRequest(myImages[i].thumb));
          thumbLoader.x = (thumbSize + padding) *i;
          mcThumb = new MovieClip();
          mcThumb.addChild(thumbLoader);
          thumbContainer.addChild(mcThumb);
          var reflection:Reflect = new Reflect({mc:mcThumb, alpha:50, ratio:170, distance:0, updateTime:0, reflectionDropoff:1});
          TweenLite.from(mcThumb, .7, {alpha: 0, ease: Cubic.easeIn})
     thumbContainer.addEventListener(Event.ENTER_FRAME, movingCode);
btw, first I used assigned thumbContainer as the mc argument (outside the loadThumbs() function) and it worked but not exactly what I wanted... because I thought it is supposed to update when the movieclip is animated but it actually didn't... when I use a scroller, only the thumbs that are first loaded to the stage get the reflection... Any suggestions?

use: 
var numberLoaded:uint=0;
var thumbArray:Array;
function loadThumbs():void
thumbArray = new Array();
     for (var i:uint = 0; i < myImages.length(); i++)
          thumbLoader = new Loader();
          thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
          thumbLoader.load(new URLRequest(myImages[i].thumb));
          thumbLoader.x = (thumbSize + padding) *i;
          mcThumb = new MovieClip();
          mcThumb.addChild(thumbLoader);
          thumbContainer.addChild(mcThumb);
          // the line below won't do anything useful.  just assign mcThumb's alpha to be zero.
          //TweenLite.from(mcThumb, .7, {alpha: 0, ease: Cubic.easeInOut})
    thumbArray.push(mcThumb);
     thumbContainer.addEventListener(Event.ENTER_FRAME, movingCode);
     thumbContainer.addEventListener(MouseEvent.CLICK, loadMainImage);
function thumbLoaded(e:Event):void
     thumbLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, thumbLoaded);
   numberLoaded++;
if(numberLoaded==myImages.length()){
// now loop through thumbArray adding your reflections:
for(var i:uint=0;i<thumbArray.length;i++){
// call the reflection class passing thumbArray[i]

Similar Messages

  • Invalid BitmapData Error #2015

    I'm getting an Invalid BitmapData Error #2015 at
    flash.display::BitmapData$iinit() that points to the line
    of code below where a BitmapData object is created.
    I am using this function to create only a few hundred
    Item objects, each of which is only 166 px by 96 px in
    size so I don't believe that the problem has to do with
    running out of memory. I also used system.totalMemory
    to trace memory consumption but it showed that only
    a few tens of megabytes were used when the error occurred.
    I have tried setting the BitmapData and Bitmap
    objects to null because that was a solution I found on another
    site. That didn't work. I tried dispose(). The error
    occurs intermittently, sometimes after running my app a few
    times and sometimes when I first load it. I am not
    refreshing my browser over and over in order to run the app.
    I cannot figure out the exact sequence of events that
    leads to this error. In earlier versions of my app, I was able to
    successfully use the exact same function (minus
    the lines where the BitmapData and Bitmap objects are set to
    null). I am not an expert at Actionscript, so perhaps
    I'm doing something wrong. Please help me out. Thanks.
              public function cloneItem(item:Item):Item {
                   var itemClone:Item = new Item(item.ID, item.name, item.bpCost, item.bcCost, item.quantity);
                   var tempBitmap:Bitmap;
                   var tempBitmapData:BitmapData;
                   var tempSprite:Sprite;
                   if (item.card != null) {
                        itemClone.card = new mcCard();
                        itemClone.card.txbCardName.text = item.card.txbCardName.text;
                        itemClone.card.setCost(item.card.cost);
                        itemClone.card.txbSet.text = item.card.txbSet.text;
                        itemClone.card.txbRarity.text = item.card.txbRarity.text;
                        itemClone.card.txbLevel.text = item.card.txbLevel.text;
                        itemClone.card.txbType.text = item.card.txbType.text;
                        if (itemClone.card.txbType.text.indexOf('Unit') == -1 && itemClone.card.txbType.text.indexOf('Hero') == -1 && itemClone.card.txbType.text.indexOf('Leader') == -1) {
                             itemClone.card.hideUnitAttributes();
                        } else {
                             itemClone.card.txbAttack.text = item.card.txbAttack.text;
                             itemClone.card.txbHP.text = item.card.txbHP.text;
                             if (itemClone.card.txbType.text.indexOf('Leader') == -1) {
                                  itemClone.card.lblMP.visible = false;
                                  itemClone.card.txbMP.visible = false;
                             } else {
                                  itemClone.card.lblAttack.visible = false;
                                  itemClone.card.txbAttack.visible = false;
                                  itemClone.card.mcSword.visible = false;
                                  itemClone.card.lblHP.x = itemClone.card.lblAttack.x;
                                  itemClone.card.txbHP.x = itemClone.card.txbAttack.x;
                                  itemClone.card.mcHeart.x = 0;
                                  itemClone.card.txbMP.text = item.card.txbMP.text;
                        itemClone.card.txbRules.text = item.card.txbRules.text;
                        tempBitmapData = new BitmapData(166, 96);
                        tempBitmapData.draw(item.card.mcImage);
                        tempBitmap = new Bitmap(tempBitmapData);
                        //tempBitmap.cacheAsBitmap = false;
                        //tempBitmap.smoothing = true;
                        tempSprite = new Sprite();
                        tempSprite.addChild(tempBitmap);
                        itemClone.card.mcImage.addChild(tempSprite);
                        //tempBitmapData.dispose();
                        tempBitmapData = null;
                        tempBitmap = null;
                        itemClone.card.buttonMode = true;
                        itemClone.card.mouseChildren = false;
                        itemClone.card.tabEnabled = false;
                   return itemClone;

    More shots in the dark...
    Check the following:
    1) The height and width may be invalid.  Change it to:
    new BitmapData (item.card.mcImage.width, item.card.mcImage.height);
    2) If that doesn't work, try it with just a single pixel
    new BitmapData(1,1);
    3) Check to see if the movieClip has been resized or transformed.
    4) Make sure the MovieClip is at 0,0 registration
    5) Try setting the alpha value to false and see if it captures a black rectangle
    new BitmapData(166,96,false);
    If it doesn't throw an error, and returns a black rectangle, it means there were no pixels for it to capture.
    6) Substitute the item.card.mcImage with a different MovieClip.
    7) And lastly, try to comment out code that comes before to see if it's something else that's causing the error.  Sometimes the error is being thrown for entirely different reasons than it says, but AS gets confused.

  • Why do I keep getting tihs message ArgumentError: Error #2015: Invalid BitmapData.

    ArgumentError: Error #2015: Invalid BitmapData.
    at flash.display::BitmapData/ctor()
    at flash.display::BitmapData()
    at com.king.flash.spaceland.texture::TextureManager/clearDynamicAtlasResource()
    at com.king.flash.spaceland.texture::TextureManager/clearDynamicAtlas()
    at com.king.flash.spaceland.texture::TextureManager/createDynamicAtlas()
    at com.king.ragnarok.spaceland.atlas::DynamicAtlasFactory/createDynamicAtlas()
    at com.king.stritz.juego::ProfilePictureLoader/load()
    at com.king.stritz.juego::ProfilePictureLoader/loadProfilePictureWithSocialUser()
    at com.king.stritz.juego::ProfilePictureLoader/loadProfilePicture()
    at com.king.stritz.view.spaceland.diorama::DioramaPortraitsView/setUpCurrentUser()
    at com.king.stritz.presenter.diorama::DioramaPortraitsPresenter/show()
    at com.king.stritz.presenter.diorama::DioramaPresenterImpl/show()
    at com.king.stritz.state.main::DioramaMainState/onEnterState()
    at com.king.stritz.state::TransitionAction/onTransition()
    at se.fearless.fettle.impl::Transition/onTransition()
    at se.fearless.fettle.impl::TransitionModelImpl/forceSetState()
    at se.fearless.fettle.impl::TransitionModelImpl/fireInternal()
    at se.fearless.fettle.impl::TransitionModelImpl/fireEvent()
    at se.fearless.fettle.impl::StateMachineImpl/fireEvent()
    at com.king.stritz.state::StateChanger/requestStateChange()
    at com.king.stritz.state.main::PerformanceCheckState/changeState()
    at com.king.stritz.state.main::PerformanceCheckState/onEnterState()
    at com.king.stritz.state::TransitionAction/onTransition()
    at se.fearless.fettle.impl::Transition/onTransition()
    at se.fearless.fettle.impl::TransitionModelImpl/forceSetState()
    at se.fearless.fettle.impl::TransitionModelImpl/fireInternal()
    at se.fearless.fettle.impl::TransitionModelImpl/fireEvent()
    at se.fearless.fettle.impl::StateMachineImpl/fireEvent()
    at com.king.stritz.state::StateChanger/requestStateChange()
    at Function/PreloadingState.as$0:anonymous()
    at Function/Assets.as$1:anonymous()
    at com.king.ragnarok.spaceland.assets.zip::ZipAssetLoader/callback()
    at Function/ZipAssetLoader.as$0:anonymous()
    at Function/ImageDecoder.as$0:anonymous()
    at Function/onComplete()

    Hi Chris
    Thanks for getting back to me. I need to be sure the Flash Player I will be installing is for windows 8.1. Can you help me with that please.
    Thank you so much. Luetta
           From: chris.campbell <[email protected]>
    To: Luetta Marshall <[email protected]>
    Sent: Friday, May 1, 2015 3:43 PM
    Subject:  why do I keep getting tihs message ArgumentError: Error #2015: Invalid BitmapData.
    why do I keep getting tihs message ArgumentError: Error #2015: Invalid BitmapData.
    created by chris.campbell in Using Flash Player - View the full discussionHi Luetta,I think the confusion here is that you are seeing a message that was meant for Flash Player developers, and Namisha assumed you were debugging your own flash code. If you are simply trying to use Flash Player, we'll need to uninstall the debug version of Flash and install the regular version instead.  Assuming you are on Windows, here are the steps required: 1.  Uninstall Flash Player by downloading and running this program:  http://download.macromedia.com/get/flashplayer/current/support/uninstall_flash_player.exe 2. Once uninstalled, open your web browser and navigate to: https://get.adobe.com/flashplayer 3. Walk through the steps on that web page to get the right version of Flash Player installed  Once you have the normal version of Flash installed, you will no longer see these error messages. If you continue to have problems, please email me at [email protected] and we can do a quick desktop sharing session so I can help you out. Thanks,Chris If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7503430#7503430 and clicking ‘Correct’ below the answer Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7503430#7503430 To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following" 
    Start a new discussion in Using Flash Player by email or at Adobe Community For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • Invalid Bitmap Data error when Flex tries to play a Crossfade transition?

    Hi All,
    I've got a Grid like this in my Flex 4 app.  When the view that contains this Grid is visible, and the view is changed to another view, my application tries to play the Crossfade effect as the transition to the other view.  My transition is defined like this:
         <s:transitions>
              <s:Transition fromState="*" toState="*">
                   <s:Parallel>
                        <s:CrossFade duration="150" target="{this}" />
                   </s:Parallel>
              </s:Transition>
         </s:transitions>
    This applies the transition to any view.  There's only one effect in there at the moment but it's in a Parallel block since I've experimented with multiple transitions.
    Now, when I'm on a view where this Grid is visible, and I try to transition to another view, I get an "Invalid BitmapData" error.  HEre's the complete stack trace:
    ArgumentError: Error #2015: Invalid BitmapData.
         at flash.display::BitmapData/ctor()
         at flash.display::BitmapData()
         at spark.utils::BitmapUtil$/getRealBounds()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:99]
         at spark.utils::BitmapUtil$/getRealBounds()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:135]
         at spark.utils::BitmapUtil$/getRealBounds()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:135]
         at spark.utils::BitmapUtil$/getRealBounds()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:135]
         at spark.utils::BitmapUtil$/getRealBounds()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:135]
         at spark.utils::BitmapUtil$/getRealBounds()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:135]
         at spark.utils::BitmapUtil$/getRealBounds()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:135]
         at spark.utils::BitmapUtil$/getRealBounds()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:135]
         at spark.utils::BitmapUtil$/getRealBounds()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:135]
         at spark.utils::BitmapUtil$/getSnapshot()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\utils\BitmapUtil.as:63]
         at spark.effects::AnimateTransitionShader/getValueFromTarget()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\effects\AnimateTransitionShader.as:283]
         at mx.effects::Effect/http://www.adobe.com/2006/flex/mx/internal::captureValues()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\effects\Effect.as:1462]
         at mx.effects::CompositeEffect/http://www.adobe.com/2006/flex/mx/internal::captureValues()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\effects\CompositeEffect.as:377]
         at mx.effects::CompositeEffect/captureStartValues()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\effects\CompositeEffect.as:358]
         at mx.core::UIComponent/commitCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9778]
         at mx.core::UIComponent/setCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9701]
         at mx.core::UIComponent/set currentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6087]
         at main/previousButton_clickHandler()[C:\Data\dev\Flex\main\src\main.mxml:48]
         at main/__previousButton_click()[C:\Data\dev\Flex\main\src\main.mxml:241]
    Here's what the grid looks like.  I experimented with adding and removing controls from the grid, and eventually narrowed it down to a a VGroup I've got in the grid.  If I remove that VGroup (and all it's children), the transition plays fine.  Add it back in, and everything blows up again.  I tried using a VBox instead of a VGroup, but there was no change--same error.  I also tried getting rid of horizontalAlign="center", and again, no change.
    <mx:Grid id='membershipGrid' >
         <mx:GridRow>
              <mx:GridItem>
              </mx:GridItem>
              <mx:GridItem>
                   <s:Label text="One Year" fontWeight="bold"/>
              </mx:GridItem>
              <mx:GridItem>
                   <s:Label text="Two Year" fontWeight="bold"/>
              </mx:GridItem>
              <mx:GridItem>
                   <s:Label text="5 Year" fontWeight="bold"/>
              </mx:GridItem>
              <mx:GridItem>
                   <!-- Comment out this VGroup, and everything works fine -->
                   <s:VGroup horizontalAlign="center">
                        <s:Label text="Monthly Autorenew"  fontWeight="bold"/>
                        <s:Label text="Payment plan option is not available" fontStyle="italic" />
                        <s:Label text="for multiple year memberhips." fontStyle="italic" />
                   </s:VGroup>
              </mx:GridItem>
         </mx:GridRow>
         <mx:GridRow>
              <mx:GridItem>
                   <s:Label text="Standard Membership" />
              </mx:GridItem>
              <mx:GridItem>
                   <s:RadioButton id="standardOneYear" group="{membershipTypeSelection}"
                                     label="{pricing.getMembership(MembershipName.STANDARD_ONE_YEAR).currencyPrice}" />
              </mx:GridItem>
              <mx:GridItem>
                   <s:RadioButton id="standardTwoYear" group="{membershipTypeSelection}"
                                     label="{pricing.getMembership(MembershipName.STANDARD_TWO_YEAR).currencyPrice}" />
              </mx:GridItem>
              <mx:GridItem>
                   <s:RadioButton id="standardFiveYear" group="{membershipTypeSelection}"
                                     label="{pricing.getMembership(MembershipName.STANDARD_FIVE_YEAR).currencyPrice}" />
              </mx:GridItem>
              <mx:GridItem horizontalAlign="center">
                   <s:RadioButton id="monthlyAutorenew" group="{membershipTypeSelection}"
                                     label="{pricing.getMembership(MembershipName.MONTHLY_AUTORENEW).currencyPrice}" />
              </mx:GridItem>
         </mx:GridRow>
    </mx:Grid>
    So, what's going on?  How can I get this transition to work?  Thanks!

    Flex harUI wrote:
    Sometimes that can happen if something gets sized too small.
    Thanks for suggesting that.  It got me thinking about some other things, and I then realized that the Grid itself was in a container with TileLayout, and a requestedColumnCount of 5.  That was a mistake--I had initially been playing with the TileLayout for my "grid" but then switched to using an actual mx:Grid control, and should have gotten rid of the TileLayout with the requestedColumnCount of 5.
    I changed my layout object to an instance of VerticalLayout, and now the problem has gone away.
    My theory, based on your suggestion that something might be sized "too small," is that when I added enough controls to my Grid (which all appeared in tile 1), tiles 2 through 5 got "too small" and thus Invalid BitmapData errors were thrown when the transition tried to figure out what bitmaps to fade in/out.
    Sound reasonable?
    Now I just have to re-enable all the other controls that I disabled while trying to hunt down this problem, and hopefully the Invalid BitmapData error won't recur.
      -Josh

  • Invalid bitmap data from drawing

    Hey guys, this is my codes:
    private function loaderComplete(event:Event):void
    graphics.clear();
    var loaderInfo:LoaderInfo = LoaderInfo(event.target);
    bitmapData = new BitmapData(loaderInfo.width, loaderInfo.height);
    bitmapData.draw(loaderInfo.loader);
    graphics.beginFill(data.color);
    graphics.beginBitmapFill(bitmapData);
    graphics.drawRect(0,0,loaderInfo.loader.width,loaderInfo.loader.height);
    graphics.endFill();
    And I encounter this error: ArgumentError: Error #2015: Invalid BitmapData.
    Is there anything I miss out or something like that?

    What are you loading?
    Check the properties on the BitmapData.

  • BitmapData issue

    I am trying to cut up a displayObject into bitmapdata chuncks and then shove those chuncks into List with an ItemRenderer, but I seem to having an issue.  Here is my stack dump.
    ArgumentError: Error #2015: Invalid BitmapData.
        at flash.display::BitmapData/get width()
        at spark.primitives::BitmapImage/measure()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\ spark\primitives\BitmapImage.as:339]
        at spark.primitives.supportClasses::GraphicElement/measureSizes()[E:\dev\gumbo_beta2\framewo rks\projects\spark\src\spark\primitives\supportClasses\GraphicElement.as:3563]
        at spark.primitives.supportClasses::GraphicElement/validateSize()[E:\dev\gumbo_beta2\framewo rks\projects\spark\src\spark\primitives\supportClasses\GraphicElement.as:3525]
        at spark.components::Group/validateSize()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\s park\components\Group.as:791]
        at mx.managers::LayoutManager/validateClient()[E:\dev\gumbo_beta2\frameworks\projects\framew ork\src\mx\managers\LayoutManager.as:888]
        at mx.core::UIComponent/validateNow()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\m x\core\UIComponent.as:7249]
        at spark.components::DataGroup/initializeTypicalItem()[E:\dev\gumbo_beta2\frameworks\project s\spark\src\spark\components\DataGroup.as:247]
        at spark.components::DataGroup/ensureTypicalLayoutElement()[E:\dev\gumbo_beta2\frameworks\pr ojects\spark\src\spark\components\DataGroup.as:266]
        at spark.components::DataGroup/updateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\sp ark\src\spark\components\DataGroup.as:1056]
        at mx.core::UIComponent/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8065]
        at mx.managers::LayoutManager/validateClient()[E:\dev\gumbo_beta2\frameworks\projects\framew ork\src\mx\managers\LayoutManager.as:931]
        at mx.core::UIComponent/validateNow()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\m x\core\UIComponent.as:7249]
        at mx.managers::PopUpManagerImpl/centerPopUp()[E:\dev\gumbo_beta2\frameworks\projects\framew ork\src\mx\managers\PopUpManagerImpl.as:472]
        at mx.managers::PopUpManager$/centerPopUp()[E:\dev\gumbo_beta2\frameworks\projects\framework \src\mx\managers\PopUpManager.as:204]
        at com.utils::PopManager$/openPopUpWindow()[/Users/work/src/com/utils/PopManager.as:34]
        at com.controller::HandlePopCommand/execute()[/Users//controller/HandlePopCommand.as:316]
        at org.puremvc.as3.core::Controller/executeCommand()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3\src\org\puremvc\as3\core\Controller.as:115]
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at org.puremvc.as3.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3\src\org\puremvc\as3\patterns\observer\Observer.as:100]
        at org.puremvc.as3.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3\src\org\puremvc\as3\core\View.as:126]
        at org.puremvc.as3.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3\src\org\puremvc\as3\patterns\facade\Facade.as:404]
        at org.puremvc.as3.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3\src\org\puremvc\as3\patterns\facade\Facade.as:387]
        at org.puremvc.as3.patterns.observer::Notifier/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3\src\org\puremvc\as3\patterns\observer\Notifier.as:49]
        at com.view::StageMediator/onPrintClicked()[/Users/work/src/com/view/StageMediator.as:178]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()[E:\dev\gumbo_beta2\frameworks\projects\framework\src \mx\core\UIComponent.as:11749]
        at com.view.components::CustomGreyNavControlBar/sendEvent()[/User/work/src/com/view/componen ts/CustomGreyNavControlBar.mxml:356]
        at com.view.components::CustomGreyNavControlBar/handlePrintClick()[/Users/work/src/com/view/ components/CustomGreyNavControlBar.mxml:267]
        at com.view.components::CustomGreyNavControlBar/__printButton_click()[/Users/work/src/com/vi ew/components/CustomGreyNavControlBar.mxml:538]

    Got it. I was calling .dispose and I guess the bitmapdata reference was being
    disposed before it was being shoved in the List. So commeted out .dispose and all works.
    J

  • Bug Problem - Bitmap image invalid 3D Game

    Hi, i'm error this is the bitmap invalid at this data on ActionScript.
    ArgumentError: Error #2015: Invalid BitmapData.
              at flash.display::BitmapData/copyPixels()
              at Shortcut_Material/comp()
    Could fix me please this flash player, this may glitches otherwise further that 3D Game.

    if you're loading your bitmap from a cross-domain, you'll need to use cross-domain permissions to use copyPixels().

  • HELP! Adobe Muse encountered an unexpected error and will have to be terminated. BD/getColorBoundsRe

    I keep getthing message when my file loads in the program "This document contains 3 links to assets being unsampled. You should resize smaller or right-mouse click on the assets in the Assets panel to see additional options."
    and then I click okay.
    I get to the plan mode and then I try to go to the design mode (so i can fix the assets) and at about 90% loading it gives me this message "Adobe Muse encountered an unexpected error and will have to be terminated.
    BD/getColorBoundsRect-ArgumentError: Error #2015: Invalid BitmapData." and i have to terminate the program...
    How can i fix my assets so i can open my program? I use muse beta prerelease.

    Well, after 20 hours of work and rebuilding most of my Muse website I finally was able to upload by site again.
    Here was my problems per above and the last 20 hours. When publishing the site it does the following: Optimize assets, exportin desktip page 1 thru 19, Fining export HTML files then uploading images which I have 2208 on this site plus other stuff uploaded.
    I can not answer why it now works as "normally"it would het error #2015 uring optimizing assets wich is an invalid bitmap data error and failed at only 9% publish process then got a 1125 index 0 is out of range0 at publish 20% complete.
    I did rewrite most of the pages and made minor changes to all of them thinking that would force all pages to be uploaded as I also took option to upload all pages instead of just those that changes. All 2008 images were reloaded onto the pages by another hint I read on how to delete all thumbnails and thus the files is to select all and press delete and it will leave one as required. Then the one left could be deleted by itself. Thanks for whoever asked the question and who answered it. This saved me a lot of time.
    Thanks to all that have taken the time to help me out. Muse is a great program but sometimes you don't have any idea if it is working at something so I found myself looking at the computer busy light to see if Muse was taking a lot of cycles. It would help to have a wider use of the cursor busy indicator as sometimes the system seemed like it was hung up but it was not.
    Thanks guys!

  • Create thumbnail from selected images

    Hi,
    in my app the user can choose some pictures from his local
    file system.
    I want to create a smaller image of every selected picture.
    So I do this for each image:
    for( var f = 0; f < e.files.length; f++ ){
    name = e.files[f].name;
    src = e.files[f].url;
    path = e.files[f].parent.url;
    files.push( e.files[f] );
    //...some other code, not important for this...//
    image = new air.Loader();
    image.contentLoaderInfo.addEventListener(
    air.Event.COMPLETE, function() {
    var ratio = null;
    if (image.width <= 100) {
    thumb_height = image.height;
    thumb_width = image.width;
    ratio = 1;
    else {
    var thumb_width = 100;
    var thumb_height = null;
    var factor = image.width / thumb_width;
    thumb_height = Math.round(image.height / factor);
    ratio = 100/ image.width;
    if (thumb_height > thumb_width) {
    thumb_height = 120;
    factor = image.height / thumb_height;
    thumb_width = Math.round(image.width / factor);
    ratio = 100/ image.width;
    var bmp = new air.BitmapData( thumb_width, thumb_height );
    var temp = air.File.createTempFile();
    var desktop = null;
    var matrix = new air.Matrix();
    var png = null;
    var stream = new air.FileStream();
    var div = null;
    var elem = null;
    matrix.scale( ratio,ratio );
    bmp.draw( image.content, matrix );
    png = runtime.com.adobe.images.PNGEncoder.encode( bmp );
    stream.open( temp, air.FileMode.WRITE );
    stream.writeBytes( png, 0, 0 );
    stream.close();
    desktop = air.File.desktopDirectory.resolvePath( toPNG(
    e.files[f] ) );
    temp.moveTo( desktop, true );
    image.load( new air.URLRequest(e.files[f] ) );
    function toPNG( orig )
    return orig.name.substr( 0, orig.name.length -
    orig.extension.length ) + 'png';
    The problem is, that the "thumbnail" is only created of the
    last selected image. I think it has something to do with the
    air.Event.COMPLETE event. But when I kick that off, an error
    occures: Error #2015: Invalid BitmapData. at
    flash.display::BitmapData().
    Hope somebody can help. Thanks in advance

    Here´s a nice example that does exactly what I want:
    <html>
    <head>
    <title>Thumbnails</title>
    <script src="library.swf"
    type="application/x-shockwave-flash"></script>
    <script src="AIRAliases.js"
    type="text/javascript"></script>
    <script type="text/javascript">
    var MAX_HEIGHT = 100;
    var MAX_WIDTH = 100;
    var files = null;
    var index = 0;
    var loader = null;
    var output = null;
    function loadImages()
    if( index < files.length )
    output = document.createElement( 'div' );
    loader.load( new air.URLRequest( files[index].url ) );
    } else {
    loader.visible = false;
    function doLoad()
    loader = new air.Loader();
    loader.contentLoaderInfo.addEventListener(
    air.Event.COMPLETE, doLoaderComplete );
    window.nativeWindow.stage.addChild( loader );
    btnOpen.addEventListener( 'click', doOpenClick );
    function doFilesSelect( e )
    files = e.files;
    index = 0;
    loadImages();
    function doLoaderComplete()
    var bmpd = null;
    var encoder = null;
    var img = null;
    var jpg = null;
    var matrix = null;
    var ratio = 0;
    var realHeight = loader.contentLoaderInfo.height;
    var realWidth = loader.contentLoaderInfo.width;
    var stream = null;
    var thumb = null;
    var thumbHeight = 0;
    var thumbWidth = 0;
    if( realWidth > 0 )
    if( realWidth <= MAX_WIDTH )
    thumbHeight = realHeight;
    thumbWidth = realWidth;
    ratio = 1;
    } else {
    thumbWidth = MAX_WIDTH;
    thumbHeight = 0;
    factor = realWidth / thumbWidth;
    thumbHeight = Math.round( realHeight / factor );
    ratio = MAX_WIDTH / realWidth;
    if( thumbHeight > thumbWidth )
    thumbHeight = MAX_HEIGHT;
    factor = realHeight / thumbHeight;
    thumbWidth = Math.round( realWidth / factor );
    ratio = MAX_WIDTH / realWidth;
    matrix = new air.Matrix();
    matrix.scale( ratio, ratio );
    bmpd = new air.BitmapData( thumbWidth, thumbHeight );
    bmpd.draw( loader, matrix );
    encoder = new runtime.com.adobe.images.JPGEncoder( 85 );
    jpg = encoder.encode( bmpd );
    thumb = air.File.desktopDirectory.resolvePath( 'thumb_' +
    files[index].name );
    stream = new air.FileStream();
    stream.open( thumb, air.FileMode.WRITE );
    stream.writeBytes( jpg, 0, 0 );
    stream.close();
    output.innerHTML = files[index].name + ': ' + realWidth + '
    x ' + realHeight;
    document.body.appendChild( output );
    img = document.createElement( 'img' );
    img.src = thumb.url;
    output.appendChild( img );
    index = index + 1;
    loadImages();
    function doOpenClick()
    var browse = air.File.desktopDirectory;
    browse.addEventListener( air.FileListEvent.SELECT_MULTIPLE,
    doFilesSelect );
    browse.browseForOpenMultiple(
    'Select Images',
    [new air.FileFilter( 'Image Files',
    '*.gif;*.jpg;*.jpeg;*.png' )]
    </script>
    </head>
    <body onLoad="doLoad();">
    <input id="btnOpen" type="button" value="Open..." />
    </body>
    </html>

  • Save images into database

    hello, i have been fighting with this for some days, i have a picture that i load with de filerence.load method. and then,
    i use the filereference.data to show the picture into the image control.
    i need to save the image into database, but i can't. i don't know how i can convert the bytearray into hexa string or binary!!!

    Hi Sai,
           I am getting the error ArgumentError: Error #2015: Invalid
    BitmapData. When I am trying to change the image into byteArray using
    BitMapData.
          Below is the code i am using for this scenario. I am trying to get
    byteArray of the image after the image is completely loaded in the
    onComplete().
    private function initFunction(event:Event):void{
    uploadFile =new FileReference();
    imgTypes=new FileFilter("images(.JPG,.JPEG,.PNG,.GIF)",*
    ".JPG;.JPEG,.PNG;.GIF;"*);
    private function browseFile():*void
    uploadFile.addEventListener(Event.SELECT, onFileSelected);
    *try
    uploadFile.browse();
    catch(err:Error)
    logData(err.message);
    private function onFileSelected(event:Event):*void
    uploadFile.addEventListener(ProgressEvent.PROGRESS, onProgress);
    uploadFile.addEventListener(Event.COMPLETE, onComplete);
    uploadFile.load();
    private function onProgress(event:ProgressEvent):*void
    logData("Loaded " + event.bytesLoaded + " of " + event.bytesTotal + *"
    bytes."*);
    private function onComplete(evt:Event):*void
    logData("File was successfully loaded.");
    *//image.source = uploadFile.data;
    image.source=uploadFile.name;
    Alert.show("image source:"+image.source);
    var bitmapData:BitmapData = new BitmapData(image.width,image.height);
    var ba:ByteArray = png.encode(bitmapData);
    Alert.show("bytes loaded"+ba);
    Thanks,
    Ravi.
    On Sat, Nov 20, 2010 at 9:19 PM, ravindharreddy Baddam <

  • AddImage in AlivePDF

    I have created the PDF using AlivePDF...works great. I want to add an image to the PDF. I am getting the error "ArgumentError: Error #2015: Invalid BitmapData."
    This is my code:
    package GUI
        import flash.display.*;
        import flash.events.MouseEvent;
        import flash.net.FileReference;
        import flash.utils.ByteArray;
        import flash.net.URLRequest;
        import org.alivepdf.fonts.CoreFont;
        import org.alivepdf.fonts.FontFamily;
        import org.alivepdf.fonts.IFont;
        import org.alivepdf.layout.Orientation;
        import org.alivepdf.layout.Size;
        import org.alivepdf.layout.Unit;
        import org.alivepdf.pdf.PDF;
        import org.alivepdf.saving.Download;
        import org.alivepdf.saving.Method;
        import org.alivepdf.images.*;
        public class CreatePDF extends Sprite
            private var _pdfByteArray:ByteArray;
            public function CreatePDF():void
                // constructor code
            public function onCreatePDF():void
                var pdf:PDF = new PDF(Orientation.PORTRAIT,Unit.MM,Size.LETTER);
                var helvetica:IFont = new CoreFont(FontFamily.HELVETICA);
                var timesbold:IFont = new CoreFont(FontFamily.TIMES_BOLD);
                var loader:Loader=new Loader();
                addChild(loader);
                loader.load(new URLRequest("header_whiteBG.png"));
                pdf.addPage();
                pdf.setFont(timesbold, 24);
                pdf.addText("Memorial Healthcare System",55,12);
                pdf.addImage(loader,null,10,100,600,70,0,1,true,"PNG",100,"Normal",null);
                pdf.setFont(timesbold, 16);
                pdf.addText("This is my Pagre Title",40,20);
                pdf.addText("This is my Sub-Header",70,25);
                pdf.newLine(20);
                _pdfByteArray = pdf.save(Method.LOCAL,null,Download.ATTACHMENT);
                new FileReference().save(_pdfByteArray, "Test.pdf");
    Any help will be most appreciated.

    I am so sorry to ask again but I have been trying to this. I understand what you are trying to do but I am still getting this error:
    C:\CreatePDF.as, Line 76    1067: Implicit coercion of a value of type flash.display:BitmapData to an unrelated type flash.display:DisplayObject.
    I did tweak the code  you gave me a little and here it is:
    package GUI
        import flash.display.*;
        import flash.events.MouseEvent;
        import flash.net.FileReference;
        import flash.utils.ByteArray;
        import flash.net.URLRequest;
        import flash.events.Event;
        import org.alivepdf.fonts.CoreFont;
        import org.alivepdf.fonts.FontFamily;
        import org.alivepdf.fonts.IFont;
        import org.alivepdf.layout.Orientation;
        import org.alivepdf.layout.Size;
        import org.alivepdf.layout.Unit;
        import org.alivepdf.pdf.PDF;
        import org.alivepdf.saving.Download;
        import org.alivepdf.saving.Method;
        import org.alivepdf.images.*;
        public class CreatePDF extends Sprite
            private var _pdfByteArray:ByteArray;
            public function CreatePDF():void
                // constructor code
            public function onCreatePDF():void
                var loader:Loader=new Loader();
                addChild(loader);
                loader.load(new URLRequest("header_whiteBG.png"));
                loader.contentLoaderInfo.addEventListener(Event.COMPLETE,f);
            function f(e:Event):void
                var pdf:PDF = new PDF(Orientation.PORTRAIT,Unit.MM,Size.LETTER);
                var helvetica:IFont = new CoreFont(FontFamily.HELVETICA);
                var timesbold:IFont = new CoreFont(FontFamily.TIMES_BOLD);
                pdf.addPage();
                pdf.setFont(timesbold, 24);
                pdf.addText("This is my Page Header Text",55,12);
    ******** pdf.addImage(Bitmap(e.target.loader).bitmapData,null,10,100,600,70,0,1,true,"PNG",100,"No rmal",null);******
                pdf.setFont(timesbold, 16);
                pdf.addText("This is my Page Title",40,20);
                pdf.addText("This is my Sub-Header",70,25);
                pdf.newLine(20);
                _pdfByteArray = pdf.save(Method.LOCAL,null,Download.ATTACHMENT);
                new FileReference().save(_pdfByteArray, "Test.pdf");
    I have marked the line where I am getting the error *****. I was concerned with the variable "loader" on that line as it is being marked by Flash as a key word. I did try changing the var name but still got the same error.

  • Error in Internet Explorer when loading from cache

    Hello all,
    I have this error in internet explorer when it's loading the swf from cache
    "ArgumentError: Error #2015: Invalid BitmapData.
        at flash.display::BitmapData()"
    If you have a solution for me I will appreciate.
    Thanks

    I've just run into this error as well. It only occurs when you have loaded your SWF into cache and you refresh the page. This error does not occur if the user opens a new tab and visits the site (even if the cache has that SWF). Right now, I am stumped on how to resolve this issue without the help of Adobe. There is a critical site launch that depends on BitmapData to work properly.
    Adobe, I will also be posting this in your bug system.

  • Care to join a temporary LCCS Transition Group? -Click here.

    I thought it be fun to create a temporary alliance with other developers, to seek a proper replacement for LCCS and collaborate to pursue a solution that may address everyone's problem. Although I encourage the conversations here in the forum it may not hurt to use a separate area for discussion to ensure continuity.
    Everyone is welcome to join, even if you are not a developer, but.. -if you are someone who cosiders himself "well trained" in the flex and server-side jedi arts, enough to do some real damage, I encourage you to join: http://www.linkedin.com/groups?home=&gid=4375612&trk=anet_ug_hm&goback=%2Egmr_4375612
    LCCS Transition Group.
    Cheers.
    +LA

    Flex harUI wrote:
    Sometimes that can happen if something gets sized too small.
    Thanks for suggesting that.  It got me thinking about some other things, and I then realized that the Grid itself was in a container with TileLayout, and a requestedColumnCount of 5.  That was a mistake--I had initially been playing with the TileLayout for my "grid" but then switched to using an actual mx:Grid control, and should have gotten rid of the TileLayout with the requestedColumnCount of 5.
    I changed my layout object to an instance of VerticalLayout, and now the problem has gone away.
    My theory, based on your suggestion that something might be sized "too small," is that when I added enough controls to my Grid (which all appeared in tile 1), tiles 2 through 5 got "too small" and thus Invalid BitmapData errors were thrown when the transition tried to figure out what bitmaps to fade in/out.
    Sound reasonable?
    Now I just have to re-enable all the other controls that I disabled while trying to hunt down this problem, and hopefully the Invalid BitmapData error won't recur.
      -Josh

  • Don´t allow drag&drop

    In my app you can drag&drop images from the file system
    into air. but now I want to forbid to drag and drop the image
    inside the application. now I get this error message when dragging
    images inside my app:
    "TypeError: Can't get property length from null value"
    and when I browse for images and then drag them inside my app
    I get this error message:
    "ArgumentError: Error #2015: Invalid BitmapData.
    at flash.display::BitmapData()
    at flash.html::HTMLLoader/nativeOnMouseMove()
    at flash.html::HTMLLoader/onMouseMove()"
    so, how can I forbid to drag images inside my app or just
    solve these errors?
    Thanks a lot!

    sorry, but...I don´t know how to do this...
    here´s my code for drag&drop into the app:
    window.htmlLoader.addEventListener("nativeDragDrop",function(event){
    var filelist =
    event.clipboard.getData(air.ClipboardFormats.FILE_LIST_FORMAT);
    var elem = null;
    var name = null;
    if (filelist.length) {
    for (var f = 0; f < filelist.length; f++) {
    name = filelist[f].name;
    elem = document.getElementById('list5');
    elem.innerHTML += name;
    function preventDefault(event){
    event.preventDefault();
    }

  • Zwei Fehlermeldungen - benötige Hilfe

    Beim starten von Adobe Muse bekomme ich die Meldung: "Dieses Dokument enthält 2 Links zu den Elementen, die gerade hochgesampelt werden...." Kann ich irgendwie feststellen, um welche Elemente es sich handelt? Außerdem bekomme ich nun beim Anschauen der Seite im Browser die Fehlermeldung: "Error #2015: Invalid BitmapData." Was hat das zu bedeuten, wie bekomme ich die Meldung wieder weg? Mein BS ist Windows 7

    Zur ersten Frage: Klicke im Asset-Panel auf das Warnschild, dann werden die "Problembilder" ganz oben einsortiert.
    Wenn diese Meldung angezeigt wird, heißt das, dass ein Bild in zu geringer Auflösung vorliegt oder dass es nach Anwenden des Befehls "Bildgröße optimieren" erneut hochskaliert wurde. In letzterem Fall kann man das Problem beheben, indem man auf den Bildeintrag im Panel rechtsklickt und den Befehl "Größere Version laden" wählt. Achtung: Die Terminologie kann abweichen, da ich gerade nicht vor dem Rechner sitze und dies nachprüfen kann.

Maybe you are looking for