3 Replies Latest reply on Mar 30, 2011 9:17 PM by Kristin95762

    having trouble embedding image with FB

    Kristin95762 Level 1

      Noob here.


      I have a Photoshop file which I opened in Fireworks so I could export it as fxg. This is all I'm trying to do, is open a WindowedApplication with a background image in it.


      FW exports an fxg file plus a folder with the png file in it. I put both of these in my graphics folder.


      This is the whole code:


      ?xml version="1.0" encoding="utf-8"?>

      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"













      <!--<graphics:Background/>-->          This one returns FXGException errors (Error reading image). Commented out for testing purposes.



      <s:BitmapImage source="@Embed('graphics/Background.fxg')"/>           This one gets transcoder errors.





      I added the d namespace hoping that had something to do with it, but I learned that had no effect.


      What is the problem here that I can't simply see an image in my window?



        • 1. Re: having trouble embedding image with FB
          Kristin95762 Level 1



          Is there a way to see images in Design View? All I see is little movieclip symbols.

          • 2. Re: having trouble embedding image with FB

            Working with local image in Flash Builder can be a little tricky. When you do this:






            It is going to look for the graphics folder, then file from your project root. This is okay, and you'll have it organized that way probably.


            Your issue will come up when you try to debug/build your project since your builds go into the bin-debug or bin-release folder inside your project directory. These directories will also need the graphics folder with your files in it.


            This can be bothersome and I usually just toss my artwork onto a server then package it up nicely when it's time to push another build.


            Hope this helps [=


            1 person found this helpful
            • 3. Re: having trouble embedding image with FB
              Kristin95762 Level 1

              Thanks Dan;


              I can't decide whether I should be a purist and do all my work strictly in FB, or if I should cheat and use Catalyst. I don't want to depend on Catalyst. In fact I can't depend on Catalyst for everything. But sometimes doing the simplest (or what should be) thing just isn't that simple.


              I finally used Catalyst to generate the code and figured out what i could strip from the code and have it still work. Funny that it used the same @Embed directive and didn't complain.


              I'll keep your ideas in mind when I'm debugging. I'm writing an AIR app, so I'm serverless.


              Thanks a lot.