Loading local images into HTML component

I need to intermix text and images for a project I'm working
on, and using htmlText seems the best way to do it. However, I
can't get it to work when the images are loaded from the local file
system.
It seems to work fine with remote images:
<mx:HTML x="480" y="191" width="256" height="315">
<mx:htmlText>
<![CDATA[
<p>Image: <img src='
http://knight.fb.hive7.com/res/img/ico/x32/coin.gif'
></p>
]]>
</mx:htmlText>
</mx:HTML>
But not with local images:
<mx:HTML x="480" y="191" width="256" height="315">
<mx:htmlText>
<![CDATA[
<p>Image: <img src='../assets/coin.gif'
></p>
]]>
</mx:htmlText>
</mx:HTML>
Anybody have any ideas or workarounds?

Hi,
I tried your solution, it did not worked, it gave me following error -
==========
ReferenceError: Error #1056: Cannot create property placeLoadStringContentInApplicationSandbox on mx.core.FlexHTMLLoader.
    at com.exa.view::TestView/changeEvt()[/home/sachin/workspace/newed/src/com/exa/view/TestView .mxml:70]
    at com.exa.view::TestView/__toctree_change()[/home/sachin/workspace/newed/src/com/exa/view/T estView.mxml:89]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9308]
    at mx.controls.listClasses::ListBase/mouseUpHandler()[C:\autobuild\3.3.0\frameworks\projects \framework\src\mx\controls\listClasses\ListBase.as:8989]
    at mx.controls::List/mouseUpHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\m x\controls\List.as:2279]
    at mx.controls::Tree/mouseUpHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\m x\controls\Tree.as:2952]
===========
Here is the code, the function gets called on change event of a tree component(not shown in code here)
===============
<mx:Panel width= "70%" height="100%" id="cpanel" paddingBottom="10" paddingLeft="20" paddingTop ="20">
        <mx:HTML id="htmlc" width="100%" height = "100%">
        </mx:HTML>
    </mx:Panel>
<mx:Script>
    <![CDATA[
          public function changeEvt(event:Event):void{
               htmlc.htmlLoader.placeLoadStringContentInApplicationSandbox = true;
               htmlc.htmlLoader.loadString(rh.content.replace(/src="\/images/mg,'src="assets'));
    ]]>
</mx:Script>
================
It would be helpful if you give more insight on your html component.
Adobe air -version - 1.5
Thanks

Similar Messages

  • Load remote images in html mail setting does not get saved. I have to turn it off every time I log in. Is this a bug?

    Load remote images in html mail setting does not get saved. I have to turn it off every time I log in. Is this a bug?

    Plug your phone into the wall charger for at least 30 minutes...make sure you have a sim card in the phone...then:
    Leave the USB cable connected to your computer, but NOT your phone, iTunes running, press & hold the home button while connecting the USB cable to your dock connector, continue holding the home button until you see “Connect to iTunes” on the screen. You may now release the home button. iTunes should now display that it has detected your phone in recovery mode, if not quit and reopen iTunes. If you still don’t see the recovery message repeat these steps again. iTunes will give you the option to restore from a backup or set up as new.
    Make sure you have no anti-virus software running or any firewalls...turn all of that stuff off.

  • Fastest way to load an image into memory

    hi, ive posted before but i was kinda vague and didnt get much of a response so im going into detail this time. im making a java program that is going to contol 2 robots in a soccer competition. ive decided that i want to go all out and use a webcam instead of the usual array of sensors so the first step is to load an image into the memory. (ill work on the webcam once ive got something substanical, lol) since these robots have to be rather small (21cm in diameter) i can only use some pretty crappy processors. the robots are going to be both running gentoo linux on a 600 mhz processor, therefore it is absoleutely vital i have a fast method of loading and analyzing images. i need to be able to both load the image quickly, and more importainly analyze it quickly. ive looked at pixelgrabber which looks good, but ive read several things about javas image handling beging crap. these articles are a few years old, and im therefore wonding if there anything from the JAI that will do this for me. thx in advance.

    well i found out why i was having so much trouble
    installing JAI. im now back on windows and i cant
    stand it, so hopefully the bug will be fixed soon. oIt's not so bad. I mean, that's why we love Java! Once your linux problem is fixed you can just transfer your code there as is.
    well. i like the looks of JAI.create() but im not so
    sure how to use it. at this stage im tying to load an
    image from a file. i no to do this with pixelgrabber
    you use getcodebase(), but i dont know how to do it
    with JAI.create. any advice is appreciated. thx.Here are some example statements for handling a JAI image. There are other ways, I'm sure, but I've no idea which are faster, sorry. But this is quite fast on my machine.
    PlanarImage pi = JAI.create("fileload", imgFilename);
    WritableRaster wr = Raster.createWritableRaster(pi.getSampleModel(), null);
    int width = pi.getWidth(); // in case you need to loop through the image
    int height = pi.getHeight();
    wr = pi.copyData(); // copy data from the planar image to the writable one
    wr.getPixel(w,h,pixel); //  pixel is an int array with three elements.
    int red = pixel[0];     // to find out what's the red component
    int[] otherPixel = {0,0,0}
    wr.setPixel(w,h,otherPixel); // make pixel at location (w,h) black.                And here's a link with sample code using JAI. I've tried several of the programs there and they work.
    https://jaistuff.dev.java.net/

  • How to load an image into blob in a custom form

    Hi all!
    is there some docs or how to, load am image into a database blob in a custom apps form.
    The general idea is that the user has to browse the local machine find the image, and load the image in a database blob and also in the custom form and then finally saving the image as blob.
    Thanks in advance
    Soni

    If this helps:
    Re: Custom form: Take a file name input from user.
    Thanks
    Nagamohan

  • Loading an image into an Applet from a JAR file

    Hello everyone, hopefully a simple question for someone to help me with!
    Im trying to load some images into an applet, currently it uses the JApplet.getImage(url) method just before registering with a media tracker, which works but for the sake of efficiency I would prefer the images all to be contained in the jar file as oppossed to being loaded individually from the server.
    Say I have a class in a package eg, 'com.mydomain.myapplet.class.bin' and an images contained in the file structure 'com.mydomain.myapplet.images.img.gif' how do I load it (and waiting for it to be loaded before preceeding?
    I've seen lots of info of the web for this but much of it is very old (pre 2000) and im sure things have changed a little since then.
    Thanks for any help!

    I don't touch applets, so I can't help you there, but here's some Friday Fun: tracking image loading.
    import java.awt.*;
    import java.awt.image.*;
    import java.beans.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.imageio.event.*;
    import javax.imageio.stream.*;
    import javax.swing.*;
    public class ImageLoader extends SwingWorker<BufferedImage, Void> {
        private URL url;
        private JLabel target;
        private IIOReadProgressAdapter listener = new IIOReadProgressAdapter() {
            @Override public void imageProgress(ImageReader source, float percentageDone) {
                setProgress((int)percentageDone);
            @Override public void imageComplete(ImageReader source) {
                setProgress(100);
        public ImageLoader(URL url, JLabel target) {
            this.url = url;
            this.target = target;
        @Override protected BufferedImage doInBackground() throws IOException {
            ImageInputStream input = ImageIO.createImageInputStream(url.openStream());
            try {
                ImageReader reader = ImageIO.getImageReaders(input).next();
                reader.addIIOReadProgressListener(listener);
                reader.setInput(input);
                return reader.read(0);
            } finally {
                input.close();
        @Override protected void done() {
            try {
                target.setIcon(new ImageIcon(get()));
            } catch(Exception e) {
                JOptionPane.showMessageDialog(null, e, "Error", JOptionPane.ERROR_MESSAGE);
        //demo
        public static void main(String[] args) throws IOException {
            final URL url = new URL("http://blogs.sun.com/jag/resource/JagHeadshot.jpg");
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    launch(url);
        static void launch(URL url) {
            JLabel imageLabel = new JLabel();
            final JProgressBar progress = new JProgressBar();
            progress.setBorderPainted(true);
            progress.setStringPainted(true);
            JScrollPane scroller = new JScrollPane(imageLabel);
            scroller.setPreferredSize(new Dimension(800,600));
            JPanel content = new JPanel(new BorderLayout());
            content.add(scroller, BorderLayout.CENTER);
            content.add(progress, BorderLayout.SOUTH);
            JFrame f = new JFrame("ImageLoader");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(content);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
            ImageLoader loader = new ImageLoader(url, imageLabel);
            loader.addPropertyChangeListener( new PropertyChangeListener() {
                 public  void propertyChange(PropertyChangeEvent evt) {
                     if ("progress".equals(evt.getPropertyName())) {
                         progress.setValue((Integer)evt.getNewValue());
                         System.out.println(evt.getNewValue());
                     } else if ("state".equals(evt.getPropertyName())) {
                         if (SwingWorker.StateValue.DONE == evt.getNewValue()) {
                             progress.setIndeterminate(true);
            loader.execute();
    abstract class IIOReadProgressAdapter implements IIOReadProgressListener {
        @Override public void imageComplete(ImageReader source) {}
        @Override public void imageProgress(ImageReader source, float percentageDone) {}
        @Override public void imageStarted(ImageReader source, int imageIndex) {}
        @Override public void readAborted(ImageReader source) {}
        @Override public void sequenceComplete(ImageReader source) {}
        @Override public void sequenceStarted(ImageReader source, int minIndex) {}
        @Override public void thumbnailComplete(ImageReader source) {}
        @Override public void thumbnailProgress(ImageReader source, float percentageDone) {}
        @Override public void thumbnailStarted(ImageReader source, int imageIndex, int thumbnailIndex) {}
    }

  • I cannot seem to load raw images into LR 2.5.  I've been using this for years.  I always load from memory card, but it gives me an unknown error message.  I tried to load from camera, hard drive, & external drive and still will not work.  I checked import

    I cannot seem to load raw images into LR 2.5.  I've been using this for years.  I always load from memory card, but it gives me an unknown error message.  I tried to load from camera, hard drive, & external drive and still will not work.  I checked import menu and nothing has changed.  I loaded the photos onto my tablet and images are fine, so do not feel it is the memory card.  Any thoughts?

    The error message probably said "unsupported or damaged"
    The T3 requires Lightroom 3.4.1 or later. You can either upgrade to a more current version of Lightroom (version 5.6 is the most recent) or you can use the free Adobe DNG Converter to convert the RAWs to DNG, which should import into Lightroom properly.

  • Loading local sound into UIWebView?

    I'm able to successfully load a local html-file into a UIWebView, and from that load a local image via the html-code.
    Loading a local sound-file from the UIWebView, however, is a different matter.
    Does anybody know why the code below only manages to display a local image but no local sound, and what the solution would be?
    (you can find the code here sinc this forum does not enable showing code unformatted in any way that I know of):
    http://forums.macrumors.com/showthread.php?p=6730846&posted=1#post6730846

    mTheBackgroundPath = [[NSBundle mainBundle] pathForResource:@"black_background" ofType:@"jpg"];
    mTheBackgroundPath = [ mTheBackgroundPath stringByReplacingOccurrencesOfString:@"/" withString:@"//"];
    mTheBackgroundPath = [ mTheBackgroundPath stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
    mTheBackgroundPath = [@"file://" stringByAppendingString:mTheBackgroundPath];
    Then I just used that path in the background="" tag in the body of the html.

  • Unable to load external image into iOS app with AS3

    Just trying out Flash Builder for iOS app development and have run into a problem right off the bat with loading an external image into an iOS app.  The actionscript is very simple (this was basically my Hello World attempt), and I'm hoping someone here can explain where I'm going wrong.  This code works in Flash Pro, and works when launched on the desktop from Flash Builder, but doesn't work on my iOS devices.
    Here's the code:
                                  var container:MovieClip = new MovieClip();
                                  addChild(container);
                                  var imageLoader:Loader = new Loader();
           imageLoader.load(new URLRequest("http://www.google.ca/intl/en_ALL/images/logos/images_logo_lg.gif"));
                                  imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, startListener);
      function startListener (e:Event):void{
                                                 container.addChild(imageLoader);
    Any thoughts on why this won't work would be greatly appreciated!

    I had the same issue, and modified my domain policy file as specified  in http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html#_Configuring_URL_M eta-Policies but the loader is not loading the file. Any ideas on how to fix this issue?

  • Unable to load TIF images into Photoshop.

    CS4 (11.0.2) and Windows 7 Home Edition.
    Have developed a problem trying to load some TIF images into Photoshop. I have a large number of images archived over a decade or more. At this point it may some of the older files that exhibit the problem. Now all these files were edited and stored using the Photoshop versions during the complete time period. The files are always saved with no compression. Have tried to load from Photoshop and clicking on the file in a file list. Photoshop just hangs and I get the message Program not responding. I can take these same files and load them into the ROXIO photo editor with no problem. Stranger yet is if I simply load the file into the ROXIO editor then "save as" back into the same folder (overwrite) the file can then be brought into Photoshop with no problem! Any ideas?

    Noel,
    Will try to keep short.
    I reinstalled Photoshop CS4 from the cd CS set. Did not uninstall first. Restarted PC and Photoshop. Still failed the same way with a 3001 image.
    Did the following, changing one item in the Edit->Preference->GPU Setting. After each change, closed Photoshop, reopened, brought in 3001 image, restored original setting. 3001 failed each time.
    * Unchecked Enable OpenGL Drawing
    * Advanced setup: Unchecked Advanced Drawing.
    * Advanced setup: Unchecked Color Matching
    Next went to the Edit->Color Profile.
    Scanned thru options and saw in the Convert Options: Engine. It was set to Adobe (ACE). ACE was the module name in the error detail!
    Only other option for this is Microsoft ICM. Changed to that, close/open Photoshop and 3001 came in no problem. So did the Nikon 3000, srgb IEC 61922 2.1 and Untagged. However, when briging in an Adobe RGB(1998) image Photoshop notes Profile Mismatch. It allows me to decide what to do (use embedded profile instead of workspace; convert color to work space color; discard embedded profile. and I choose use the convert color and it loads ok. At least it loads the image! Will use this approach for now. I need to get educated on color profiles!!
    Joe

  • Making a loaded external image into a button in Actionscript

    My name is Steve Oatman I am a student at
    AIO for a Web Design Diploma
    class: Interactive Telecommunications IMD412 XA
    Professors to bussy!
    I have a flash web site that I am putting together. I am using AS to load some images from an external source. These images are being loaded into a movieclip. These images need to become buttons once they are loaded. The images will link to the particular menu category pages beef, chicken, etc.
    The images are loading fine they just are not responding like a button or link.
    I am getting two error referencing the buttonMode and usehandCursor. Below is just one image that I am working on till I get it to work.
    I am getting these two Compiler error code:
    1119: Access of possibly undefined property buttonMode through a reference with static type flash.display:Loader.
    1119: Access of possibly undefined property useHandCursor through a reference with static type flash.display:Loader.
    This is what I have.
    var myLoader01:Loader = new Loader();
    myLoader01.load(new URLRequest("entrees_images/beef/beef01.gif"));
    addChild(myLoader01);
    myLoader01.x = -269;
    myLoader01.y = -164;
    myLoader01.buttonMode = true;
    myLoader01.useHandCursor = true;
    myLoader01.addEventListener(MouseEvent.CLICK, beefClick);
    function beefClick(event:MouseEvent):void{
    gotoAndStop("beef");
    From me searching online I thought the
    name.buttonMode = true;
    turned the element into a button!
    I have included the fla file. This is in the menuItems_mc which is located in the pageContent_mc frame 40 layer page Image or of course the library.
    I know this is a little in depth sorry and any help would be greatly appreciated.
    Steve
    713/742-3325

    Try something along the following lines:
    var myLoader01:Loader = new Loader();
    function addIt(evt:Event):void{
       var aBtn:MovieClip = new MovieClip();
       aBtn.x = -269;
       aBtn.y = -164;
       aBtn.buttonMode = true;
       addChild(aBtn);
       aBtn.addChild(myLoader01);
       aBtn.addEventListener(MouseEvent.CLICK, beefClick);
    myLoader01.contentLoaderInfo.addEventListener(Event.COMPLETE, addIt);
    myLoader01.load(new URLRequest("entrees_images/beef/beef01.gif"));
    function beefClick(event:MouseEvent):void{
       gotoAndStop("beef");

  • Load XML content into HTML enabled TextField

    I'm trying to figure out how to use html such as <br />
    loaded from an XML element into a TextField.. if I use something
    like
    <desc>my description<br />line 2</desc> I
    get 3 nodes instead of one when loading the XML file. If I use
    something like <desc>my description&lt;br /&gt;line
    2</desc> then I get <br /> in the actual text.
    Can anyone clue me in as to how to store HTML in an XML
    element so I can load the content into a Dynamic TextField with
    HTML enabled?
    Thanks much!

    use the latter in your xml and use the htmlText property of
    your html-enabled textfield to display your text.

  • IOS 5: Manually load REMOTE images in HTML emails ...?

    I've been clamoring for this feature forever, and Apple finally added it in 3.0.... the ability to NOT download remotely hosted HTML images in emails [mainly to prevent additional spam]..... unfortunately, if you turn off the loading of remote images in your settings, you're unable to load them in manually on a per-email basis.
    SO CLOSE!
    Does anyone know if this is possible now on iOS 5? Would love it to work like their desktop mail app

    varjak paw wrote:
    Settings -> Mail, Contacts, Calendars -> Load Remote Images -> Off
    Regards.
    Yes that's how you turn it off.  Now that you have it off, and an image arrives whose images you want to view, you can't do it.  You can turn the setting back on, but then all the other emails whose images you don't want to open, will open, leaving you vulnerable.  There should be a button in the mail viewer to load images when viewing an e-mail if this setting is off, just like Mail in OSX.  I think it's an oversight.

  • Air 3.4 breaks loading local images (Mac OS X)

    Since updating to Air 3.4, my Air app no longer displays local images. Is this a known issue? If so what is the fix?
    I'm using the 'mx.image' component to dynamically display an image specified by the user. The image components 'source' property is set to the specified file's 'url' property. Image is displayed as a broken image icon. Was working until the 3.4 update.
    Adobe AIR version: 3.4.0.2540.
    Mac OS X 10.6.8. On Windows 7 the issue does not occur.
    Adobe Flash Builder 4.0.1
    Flex SDK 4.1
    Thanks for any info!
    - Felix

    Hi Chris,
    thanks for the response. I'm currently making a simplified repro case.
    It's hard to debug, since the problem does not occur in Flash Builder debug mode, only when publishing and running with AIR 3.4. Is there a way to make the FB debugger run using AIR 3.4, without updating Flash Builder and the Flex SDK?
    - Felix

  • Load random images into particular areas?

    Hey there I just have a quick question before I try my hand at Adobe Edge. I'm looking at doing a small interactive from this design...
    what I want to happen is when you click on the "Random scenario" button it loads this...
    where the area that holds the "2013 scenario" text is a random image (and that can be scrolled up and down), and same for the smaller area to the bottom right called "Weather Condition" (ie it will be a random image but doesn't need any scrolling).
    Is this something Adobe Edge could help me with?
    Thanks in advance.

    Here is a basic sample of loading a random map image with scroll in Edge:
    http://www.meschrene.puremadnessproductions.net/Samples/Random-Image/Test1.html
    http://www.meschrene.puremadnessproductions.net/Samples/Random-Image/Test1.zip
    This should help you get a basic idea of what to do.
    I you have any questions let me know

  • Loading Aperture images into Pages doc

    Have Aperture 2.1.4 and Pages '09. When using the Media tool to load images from the Aperture library (w/ images stored on internal HD), only option given is to load iPhoto images; Aperture does not appear and I do not use iPhoto. When I have tried to navigate to an onboard Aperture Library using Edit>Choose, my Aperture libraries are unable to be selected. What is the best solution?

    Henrik Holmegaard wrote:
    Hmm ... interesting idea. If the idea is to drag and drop unrendered ('undeveloped') raw image data into page, why does the system not permit this without indicating an intervening application to render ('develop') the raw image data? Somewhere, somehow there has to be rendering ('developing') of raw image data of which there are as many formats as there are makes and models of digital camera, so it might make sense for the system to ask for software that is able to do the rendering ('developing').
    Maybe in a future version but, at this time, Pages clearly states:
    Pages accepts all QuickTime-supported formats, including the following graphics file types:
    • TIFF
    • GIF
    • JPEG
    • PDF
    • PSD
    • EPS
    • PICT
    I'm not sure that this statement let us guess that Aperture files are accepted.
    If someone want to insert such a file, why not build an Automator process grabbing the file,
    developping it
    then inserting it in Pages ?
    Apple delivers tools but can't use them for us !
    Yvan KOENIG (VALLAURIS, France) mardi 6 octobre 2009 11:00:52

Maybe you are looking for