Local image load and edit

Hello,
I already spend 2 days on this problem. I want to load local
image into AIR application, edit and save as a new image. I know
there are some security issues, which don't allow Loader class to
access data on different domains than SWF file, but does it affect
AIR too and local files editing? Well, sympthoms are the same.
Here is the code:
//pointing to an image
var imageFile:File =
File.documentsDirectory.resolvePath('someimage.png');
//new file stream
var fileStream: FileStream = new FileStream();
fileStream.open(imageFile, FileMode.READ);
//reading image into bytearray and closing stream
var imgBytes: ByteArray = new ByteArray();
fileStream.readBytes(imgBytes);
fileStream.close();
//tried to use LoaderContext and some workarounds available
in the web - none is working
//var loaderContext: LoaderContext = new LoaderContext();
//loaderContext.checkPolicyFile=true;
//loaderContext.allowLoadBytesCodeExecution = true;
//creating loader and injecting image bytes into it
var loader:Loader = new Loader();
loader.loadBytes( imgBytes, loaderContext );
//trace(loader.content); // will give you null
//creating a sprite and adding image to it
var somesprite:Sprite = new Sprite();
somesprite.addChild(loader);
//creating output file
var myFile:File =
File.documentsDirectory.resolvePath('newimage.png');
var myFileStream:FileStream = new FileStream();
myFileStream.openAsync(myFile, FileMode.WRITE);
//Here is fun part: BitmapData capture everything in sprite
except image
var bd:BitmapData=new BitmapData(200,200);
bd.draw(someSprite);
var ba:ByteArray = PNGEncoder.encode(bd);
myFileStream.writeBytes(ba);
myFileStream.close();
//However image will visible in the screen
root.addChild(someSprite);
Maybe somebody already noticed that issue and know the
solution? It's not very sophisticated example - it won't let you do
even a simple image editor. I'm sure there must be some way.
Thanks in advance

I think, then, that your problem is that you aren't waiting
for the image to load before trying to encode and write it to disk.
I tried your code snippet and could write the image once I put the
encodeing and writing bit into an event handler that fired when the
image finished loading.

Similar Messages

  • GUI to load and edit documents in Database

    we have a requirement as follows:
    The users should be able to load the documents in the Database and also at a later point be able to check out the documents, edit and save it back to the database.
    is there any GUI user interface already available with Oracle IFS and intermedia or do we have to create a UI to use the INSERT statments or SQL Loader
    Any answers will be helpful
    -nandeep

    Guess what? iFS was build to handle your exact requirement! iFS comes with protocol servers that will allow users to load documents into the database. For example, they can FTP their files in. Or, they can use "map network drive" and mount an "O:" drive on their windows box and copy files into iFS. Then, we support a web-based GUI that allows the users to check out their documents, apply ACLs to them, and check in new versions! How's that sound?
    You will never use SQLloader again!

  • Local image resize and upload

    Hi guys,
    I've been checking around the net for a way to implement the following:
    user wants to upload a large image. the image is resized locally on their computer to a 60kb small image. this image is then uploaded and used.
    Is there a way to do this with flash? or what is the best method? (NB: I'm not interested in using Java)
    thanks for any info or links.
    Jeff

    Well in short, you need a second language to support that,
    e.g. PHP/ASP/CF.
    First you'll have to build a GUi in which you can upload the
    jpg, putting it to the server using php/asp/cf, then you'll need to
    make a call to that image, (importing it into your flex), then
    you'll have to set the parameters for the resizing, then you'll
    have to call a php/asp/cf script which does te resizing

  • Image quality and editing in pages

    when i insert an image into an a4 doc and I'm viewing at 100% image quality is poor but fine if i zoom in? Also image editing such as saturation etc seems to revert on its own?

    Hi Matti. Thanks for your work and help you are giving to me and others. I have printed off your info and will try and get my poor old brain round it!. So many people are having the same problem with iMovie it's amazing that the mac software dept has no don anything to rectify this bug and or problem. I have downloaded the software you state "Photo to Movie" but it does not seem to have the same things as iMovie with all the fancy transitions of images and music in the background, I have tried 4 images in this software and thay come up on full screen as 100% perfect, I still have to work out how to get them onto DVD with some kind of presentation. I want to start in the field of wedding photography and need some high end presentation software for digital wedding albums or Imaging with transitin affects, what would you recomend?. I am in spain so we are on PAL here, I think!. I have people over here in the Spanish Mac forums asking about the same problems, is it OK with you to translate some of yours and pass over to them in Spanish?. best regards. Kevin

  • Image loading and random numbers?

    Hi. I'm programming a text-based RPG using Swing.
    But I have two things to hamper my progress:
    1) I can't create random numbers
    2)I can't put images onto my window.
    Can anyone tell me a method to use do do these two things? Thanks.

    Hi. I'm programming a text-based RPG using Swing.
    But I have two things to hamper my progress:
    1) I can't create random numbersSee java.util.Random
    2)I can't put images onto my window.See Graphics.drawImage
    >
    Can anyone tell me a method to use do do these two
    things? Thanks.

  • Need help with image gallery and preloader

    Here is my  portfolio site currently. WWW.PALMEI.COM. When you go into the the galleries you can view the images; the images load and it's all working fine. But if I was to go back on the page before the image was to load the image loads later which is then in the way of everything and cannot be deleted or removed. What would a solution be for solving this problem. Also, my preloader is not working at all as you can tell.
    Here is my code in frame 1 for the perloader:
    [AS]
    stop();
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreLoader);
    function updatePreLoader(evtObj:ProgressEvent):void
                        var percent:Number = Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
                        preloader_txt.text = percent+"%";
                                  if (percent==100) {
                                            nextFrame ();
    [/AS]
    Thank you very much for your help. Have developed headache and need some new eyes on it.

    Thank you again Ned for your reponse as you helped me solve the image array problem last week or so ago.
    Here is the code:
    [AS]
    stop();
    import fl.transitions.Tween;
    import fl.transitions.easing.*
    import fl.transitions.TweenEvent;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    var sep3Tween4:Tween = new Tween(Sep2_mc, "y", Regular.easeOut,338 , 655, 1, true);
    var sepTween4:Tween = new Tween(Sep_mc, "y", Regular.easeOut,0 , -320, 1, true);
    BoyBack.addEventListener(MouseEvent.CLICK, Portfolioclick);
    function Portfolioclick(evtObj :MouseEvent) {
              gotoAndStop("Portfolio");
               removeChild(B);
    var BoyBackTween:Tween = new Tween(BoyBack, "y", Regular.easeOut,510,487,2, true);
    BoyBackTween.addEventListener(TweenEvent.MOTION_FINISH, onfinis);
    function onfinis(e:TweenEvent):void {
    BoyBackTween.yoyo();
    var arrayB:Array = [ B1, B2, B3, B4, B5, B6, B7, B8,B9, B10, B11, B12];
    var arrayImages:Array = ["ill_1.jpg","ill_2.jpg","ill_3.jpg","ill_4.jpg","ill_5.jpg","ill_6.jpg","ill_7.jpg","ill _8.jpg", "ill_9.jpg","ill_10.jpg","ill_11.jpg","ill_12.jpg"];
    var imgLoader:Loader = new Loader;
    var B:BlackBox = new BlackBox();
    B.addChild(imgLoader);
    for (var i:uint=0; i<arrayB.length; i++){
         arrayB[i].mouseChildren = false;
         arrayB[i].addEventListener( MouseEvent.MOUSE_OVER, onButtonOver);
         arrayB[i].addEventListener( MouseEvent.MOUSE_OUT, onButtonOut);
         arrayB[i].addEventListener( MouseEvent.CLICK, onButtonRemoveB);
               arrayB[i].addEventListener( MouseEvent.CLICK, onButtonClick);
               arrayB[i].imgNum = i;
                     imgLoader.y  = 100;
                          imgLoader.x =275;
                          B.y = -55;
                     B.x =-100;
    function onButtonOver( e:MouseEvent ):void {
         var B:MovieClip = MovieClip(e.target);
         if(B.tween){
           B.tween.stop();
         B.tween = new Tween( B, "y", Regular.easeOut,600, 591, .5, true );
    function onButtonOut( e:MouseEvent ):void {
         var B:MovieClip = MovieClip(e.target);
         if( B.tween ){
           B.tween.stop();
         B.tween = new Tween( B, "y", Regular.easeOut, 591, 600, 1, true );
    function onButtonRemoveB( e:MouseEvent ):void {
    removeChild(TwoDtxt);
    function onButtonClick( e:MouseEvent ):void {
       if(this.contains(B)){
           removeChild(B);
       imgLoader.load(new URLRequest(arrayImages[e.currentTarget.imgNum]));
       imgLoader.contentLoaderInfo.addEventListener( Event.COMPLETE , loaded);
    function loaded(event:Event):void {
         addChild(B);
          var targetLoader:Loader = Loader(event.target.loader);
    var AlphaTween1:Tween = new Tween(T1, "alpha", Strong.easeOut, 1, .20, 2.5, true);
    var AlphaTween2:Tween = new Tween(Bottom1, "alpha", Strong.easeOut, 1, .20, 2.5, true);
    [/AS]
    Before the image loads if you were to click on the boy with the balloon"the back button" the image would than load later on say the"portfolio" part of the site.

  • Loading and parsing XML

    what is the best method for loading external XML (with
    inherent HTML) content into Flash and into the TextArea component?
    here is the requirement:
    i have an image loader and a TextArea together on the screen.
    a "story" is loaded which will present a series of images (in the
    image loading) associated with a corresponding text (in the
    TextArea). a "story" has multiple image/text sections that are
    navigatied through with FRWD/BACK buttons. any given section can
    also have multiple sub-sections or "frames".
    here is a diagram of the flow (in this case there would be 5
    click throughs: 5 text/image sequences, but all contained only
    within 4 sections):
    http://jalaka.com/lab/ia/story_nav.jpg
    below is my proposed sample XML structure. i want Flash to
    recognize how many sections and frames within sections there are in
    each story XML document - in order to generate a corresponding
    navigation structure (a tab for each section). HTML content will be
    immediate availble to loadinto TextArea as user move forward in
    sequence with nav. and images references can also be preloaded into
    available MC containers to be swapped into place as user navigates
    forward in sequence. also need to read and store attributes for
    each node in the XML to come up in MCs in sequence. and must also
    be able to parse XML in a way to place simple HTML formatted
    content (within XML) into the TextArea.
    would Arrays be used?
    <story title = "Story Title">
    <section num = "1" title = "Section One Title" >
    <frame image = "1.jpg" caption = "caption text
    here"><b>Content</b><br><br>content
    content content</frame>
    </section>
    <section num = "2" title = "Section Two Title" >
    <frame image = "1.jpg" caption = "caption text
    here"><b>Content</b><br><br>content
    content content</frame>
    <frame image = "2.jpg" caption = "caption text
    here"><b>Content</b><br><br>content
    content content</frame>
    </section>
    </story>

    Placing the XML into an array is a great plan. What you want
    is each array element to be an object containing the section data.
    Another plan is to use a List or Combox component. Again each
    data property element would be an object containing the section
    data.

  • ImageIcon & Lazy image loading

    The whole day I'm fuzzing around with loading an ImageIcon lazily. I suppose you know what lazy means. I want to load my icons when they have to be painted on the screen, because I use thousands of them. I read the "How to Use Icons" tutorial (http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html). With its ArrowIcon implementation of Icon (http://www.iam.ubc.ca/guides/javatut99/uiswing/misc/example-swing/ArrowIcon.java) and its IconDemoApplet (http://java.sun.com/docs/books/tutorial/uiswing/misc/example-1dot4/IconDemoApplet.java). However, I'm still confused. I also took a look at the ImageIconProxy example of the proxy pattern (http://www.javaworld.com/javaworld/jw-02-2002/jw-0222-designpatterns.html). Finally I got the following code (the IconProperties part can be ignored). I'm afraid that this does not what I want. I have now only a few images, so I can't measure it directly. Does my class exactly the same as the ImageIcon class itself? Is there no postponing of instantiation because I subclass ImageIcon? Do I have to implement the interface Icon instead? Do I have to copy all the stuff in ImageIcon to my implementation in that case? Or is it better to extend the Image class to provide functions like described beneath (check upon existence).
    And for completeness. I extend this LazyIcon object subsequently with a class named LayeredIcon to create combined icons.
    * The class <code>LazyIcon</code> implements <code>ImageIcon</code>
    * because their will be at least some calls like:
    * <pre>
    *   Icon icon = new ImageIcon(imageURL);
    *     Image image = icon.getImage();
    *     image = image.getScaledInstance(...);
    *   Icon icon2 = new ImageIcon(image);
    * </pre>
    * Besides that I want to add a function <code>IconExists</code> and
    * to add lazy image loading, and maybe also background loading.
    * This doesn't work, so it seems like in the constructor of
    * ImageIcon there is done more than only setImage(image).
    * @author A.C. van Rossum
    public class LazyIcon  extends ImageIcon {
      boolean isIconCreated = false;
      protected Image image;
      protected IconProperties properties;
       * The <code>LazyIcon</code> stores the <code>Image</code> until
       * the moment it has to be created. It has default icon properties.
      public LazyIcon(Image image) {
        this(image, IconProperties.DEFAULTICON);
      public LazyIcon(Image image, IconProperties properties) {
        this.image = image;
        setIconProperties(properties);
      //other constructors have to follow
       * The method <code>setIconProperties</code> enables the user
       * to change the properties of an icon, before calling the
       * method <code>paintIcon</code>.
       * @param properties A set of properties: dimension, etc.
      public void setIconProperties(IconProperties properties) {
        this.properties = properties;
      public int getIconHeight() {
        return isIconCreated ? super.getIconHeight() : properties.getHeight();
      public int getIconWidth() {
         return isIconCreated ? super.getIconWidth() : properties.getWidth();
       * The method <code>paintIcon</code> does only set the image of
       * the ImageIcon class lazily (when this function is called.)
      public void paintIcon(final Component c, Graphics g, int x, int y) {
        if(!isIconCreated) {
          setImage(image);
          isIconCreated = true;
        super.paintIcon(c, g, x, y);
      public Image getImage() {
        if (isIconCreated)
          return super.getImage();
        else return image;
    }Is my problem formulation clear enough? Many thanks in advance if you want to give it a look.
    Andy

    I spent some more time looking at the programs today, and it seems that all of the students involved were using a graphics library called objectdraw (http://cortland.cs.williams.edu:16080/~cs134/eof/). As far as I can tell, the objectdraw source code isn't public, so I can't say which (if any) of the standard methods they were using.
    After some work, I managed to produce a method with the same parameters as the objectdraw getImage method that used the AWT Toolkit. When I overrode the objectdraw version in the students' code, the bug (at least for the moment) seems to have gone away. So the problem may be in that other library.
    Does anyone else have experience with objectdraw? Is this a known bug, or could this be something else...?

  • How to read images from local hard disk and display in tile layout

    Dear Folks,
    I have 100 images in a folder @ local hard disk (E drive).
    I would like to display them in Tile view of 3X3.
    I have options (Radio buttons) to chnage the layout at runtime to 4X4 , 5#5 and 6X6.
    Also when the change in layout happens, I wanted to make use of backgroudLoading of image view so that user do not want to wait till the entire tile loads.
    How do I achive this requiremet?
    Sample code if any of great help. Thanks in advance.
    Edited by: JavaFX_Duo on Jul 9, 2009 12:02 PM

    1. So I would like to know which is the {color:#3366ff}best way to load local images in ImageView{color}.I'm no expert, but is there a reason that you are using Swing to do the loading?
    2. secondly, currently the system displays all images only after the completion of creating all images. {color:#3366ff}How to display images as and when they are created.{color} So that the user has a feeling that the images are loading.JavaFX Image class let you display a lightweight placeholder, and you can bind the progress to some kind of visual indicator. I don't think you can display an image that is partially loaded.
    def PATHS: String[] = [
        "C://Ariel Atom//ariel-atom-1.jpg",
        "C://Ariel Atom//ariel-atom-2.jpg",
        "C://Ariel Atom//ariel-atom-3.jpg",
        "C://Ariel Atom//ariel-atom-5.jpg"
    function getImage(path: String): Image {
        Image {
            url: "file:///{path}"
            backgroundLoading: true
    Stage {
        title: "Image Tiles"
        width: 1024
        height: 800
        scene: Scene {
            content: [
                Tile {
                    columns: 2
                    tileWidth: 400
                    tileHeight: 400
                    content: for (i in [0..3]) {
                        ImageView {
                            image: getImage(PATHS)

  • Jasper report on HTML when one image loaded from database and for the other

    How to generate jasper report on HTML when one image loaded from database and for the other we give a image path
    My code
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
              exporter = new JRHtmlExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
              exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, strImageInputDirectory);
         exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, strImageOutputPath == null ? "." : strImageOutputPath);
         exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);
         exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
         exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
              exporter.exportReport();
              byte[] bdata = ((ByteArrayOutputStream) baos).toByteArray();
    Can any one help pls
    Message was edited by:
    ameet.au

    hey sorry for posting it in this forum.
    but do u have sample code for making it work.. since i am able to do it on PDF format(image from Database and another stored in the webserver) using
    byte image[] =(byte[]) outData.get("image");
                        ByteArrayInputStream img = new ByteArrayInputStream(image);
                        hmimg.put("P_PARAMV3", img);
    print = JasperFillManager.fillReport(reportFileName, hmimg, jrxmlds);
    bdata= JasperExportManager.exportReportToPdf(print);

  • Can I use iPhoto to view and edit images not stored in the iPhoto Library

    Hi folks,
    I'm a newbie to Mac after 20+ years on PC...just switched 2 weeks ago....wish I'd done it years ago. Everythings so easy and fast...e.g. setup wireless broadband in 25 mins with no probs....and I have never done anything like that.
    Here's my Q.
    I have a load of images, downloads and scans, of old manuscripts, authors etc. which I don't really want in my iPhoto library (which I would like to keep for actual photos. Is it possible to point iPhoto to another location (say in Documents) where it will let me view and edit these images without importing them into the library.
    Alternatively can I view images as thumbnails in this other locations, and not as default file type icons.
    Hope this is plain,
    JP_MAC
    Imac G5 17" 1.9Ghz   Mac OS X (10.4.3)  

    Hi jp-mac,
    iPhoto 5 imports all images into it's own database. (this has changed with iPhoto 6 so you might want to check out iLife 6)
    The other files you want to view but not have in the library...are they image files?
    If so, you can view that folder as icons and then make the icons larger so you can see what they are.
    To do this open the folder in question. click the first icon on top of View in the toolbar. This will make that folder contents view as icons
    Now go all the way to the top of your screen and click on View>show view options.
    Slide the icon size slider all the way to the right to view them larger. Also make sure you have the "show icon preview" checked.
    This will work most of the time, but sometimes if you edit images in other applications they might not make icon previews, so check their preferences to make sure you have that checked.
    There is also a little third party program that will do it for you.
    One is called Pic2Icon
    Pic2Icon
    Another one is a contextual menu item called QuickImageCM.
    QuickImageCM
    check out that page because there are some other useful contextual menu items that I use all the time.

  • Slow image loading in Facebook and other sites.

    In some sites, especially Facebook, I've a slow image loading. For example, when I search for a person on Facebook, then the profile image of poeple takes 6-7 secons to load.
    I've installed Firefox yesterday, so I exclude that I have to delete cookies, etc. With Chrome, Facebook load images much more faster. Re-installing shockwave, the loading is faster, but not enough.
    Any suggestions?

    After looking around a bit, I found an add-on called FastestFox.
    You can find the add-on here: [https://addons.mozilla.org/nl/firefox/addon/fastestfox-browse-faster/ FastestFox].
    I haven't done too much research to the actual add-on itself, but after installing it in Firefox myself and using the Facebook person searcher I noticed the images and also other things like websites loading a lot faster.
    I hope this add-on helps you.
    Edit: The add-on adds some extra options when you right click a website (to download things from the website). You have to decide if you think this is worth the extra speed.

  • Efficient loading and rendering of multiple images: Need advice

    I have an application that allows the user to customize and display full-screen consoles of various information. The console can have a background image. Additionally, the console can contain any number of components...one of which is a "Image" component.
    Both the console background and the image component can refer to multiple images...if multiple images are referenced, the displayed image switches every X seconds.
    The application has a repository into which users can load their images so that they are managed by the app.
    Now, my problem:
    In the old version of my application, I loaded ALL images into memory at startup and when users added them to the repository. This way, each image was available for display very quickly. When it needed to be displayed, I'd just scale it appropriately and display it. Problem is that this used a LOT of memory...I have the full image in memory AND the scaled image in memory.
    In the newer version of my application, I now load images from disk on demand. When an image needs to be displayed, it's loaded from disk, scaled and displayed. This uses MUCH less memory...but I'm finding that it's slow and can block my user interface from updating...
    I guess I'm probably looking at something in between where I cache the images that MIGHT be displayed by a console. That's better than loading ALL images into memory, and it's better than ALWAYS going to disk. It's just a matter of the logic around finding out what images need to be loaded...loading them in a background thread, blah blah blah.
    Anyone had to deal with a problem like this? Any suggestions?
    Here's my class that acts as the proxy to the image on disk:
    public class ImageProxy extends PersistentComponent {
         public static final long serialVersionUID = 1L;
         public static final String PROP_URL = "URL";
         private URL url;
         public ImageProxy (URL url, String name) throws InstantiationException {
              this.setName(name);
              this.setURL(url);
         public void setURL (URL url) {
              URL oldURL = this.url;
              this.url = url;
              this.changes.firePropertyChange(PROP_URL, oldURL, url);
         public static ImageProxy createImageProxy(File file, XMLParseLog parseLog)
                   throws InstantiationException {
              parseLog.inform("Creating new image");
              parseLog.right();
              ImageProxy newImageProxy = null;
              try {
                   newImageProxy = new ImageProxy(file.toURL(), file.getName());
                   newImageProxy.setSizeOnDisk(file.length());
                   newImageProxy.setLastModified(new Date(file.lastModified()));
              } catch (InstantiationException e) {
                   parseLog.error(e.getMessage());
                   parseLog.left();
                   throw e;
              } catch (MalformedURLException e) {
                   parseLog.error(e.getMessage());
                   parseLog.left();
                   throw new InstantiationException(e.getMessage());
              parseLog.left();
              return newImageProxy;
          * Returns the theImage.
          * @return ImageIcon
         public BufferedImage getImage() {
              try {
                   return ImageIO.read(this.url);
              } catch (IOException e) {
                   return new BufferedImage(100,100,BufferedImage.TYPE_INT_RGB);
         public URL getURL() {
              return url;
    }The other option (and it's an easier option) I was thinking of was to have the image proxy class cache the BufferedImage itself upon the first request.
    That way, only used images are loaded into memory. I could also then have a thread that would occasionally sweep through all the image proxies and clear out the buffered images of the ones that haven't been requested in X minutes.
    Edited by: jneau on May 18, 2008 7:38 PM
    Edited by: jneau on May 18, 2008 7:45 PM

    I had a similar problem, but with prepared SQL statements--Our solution was similar to your last comment. Without going into the details, we basically made a circular queue that cached the prepared statements, in the system we were using a the time you could only have a set number of prepared statements--and it was not very many, the queue had an aging function so when we had to have a new prepared statement we would use the handle to the one that had the most ancient last referenced time. In this manner we made sure that those statements that were being referenced frequently were the ones that were available.
    This does have a few weaknesses:
    1 - you still have to stringently manage your limited resources, in your case you're going
    to have to tune and do trial and error to find that sweet spot to balance your app.
    2 - if you have a bunch of 1 timers, then there is no benefit.

  • Image loads locally but not on Website?

    I have constructed a slide show viewer for use on a website.
    The swf loads jpeg images which are contained in the same
    directory. This works well on my local machine but when uploaded to
    a website and called up by an html file, the swf runs and shows the
    correct backgrounds but fails to load any jpegs. I assume that the
    problem is to do with the transfer of the variable 'Select_picture"
    into the loadMovie statement?
    The following loop (step variable = pic_no) works locally but
    not on website:-
    >>var Select_picture:String="Pic"+pic_no+".jpg";
    >>var Select_mc:String="mc"+pic_no;
    >>
    >>this.createEmptyMovieClip([Select_mc], depthnow++);
    >>loadMovie([Select_picture], [Select_mc]);
    In order to prove that a picture could be loaded on the
    website, I simplied the code to :
    >>loadMovie("pic1.jpg",[Select_mc]);
    and this worked.
    So, I tried to transfer the same string directly via the
    variable;-
    >>var Select_picture:String="Pic1.jpg";
    >>
    >>loadMovie([Select_picture], [Select_mc]);
    But this does not work.
    Any suggestions would be greatly appreciated.
    Regards
    Dave

    Thanks , Arunkkumar2207j and ggshow for your suggestions.
    1, The image size isn't a problem because the one I used for
    the test is only 200k. And the single test image loads very quickly
    on the website.
    2. I don't think the depth of the movie clip is a problem
    either because depthnow starts at a very large number and is
    incremented for each clip and works well for multiple clips on my
    local machine. Also when loading a single image is should not be a
    problem. Also, I think I proved that was working with the single
    image test?
    3. The htm, swf and images are in the same directory. But for
    the test, I ran the swf directly on the website (without using the
    htm file to load it)
    Please keep the suggestions coming....!
    Many thanks
    Dave

  • 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

Maybe you are looking for

  • How can I create a new screen to upload an attachment in SRM?

    Hi everyone, I need to create a new screen that will upload a new attachment in a BID. I already know how to create the screen and ITS. According the standard screen 0100 in program SAPLBBP_PDH_TEXT, I need an applet called "CFILESAPP" and then use t

  • We are desperately waiting for a new firmware for ...

    hello nokia, we are using one of your most popular mobile the n73- music edition ( product code for my mobile 0564012) as it is seen over the internet that nokia is rolling out firmware updates for their s60v3 devices like some of the e-series.., i j

  • My time capsule stopped giving WIRED devices IP addresses (Wireless is fine). How do I fix this?

    I have several devices on my network, and am using a 2TB Time Capsule. All of my wireless devices work fine- including 2 MBP's, iPad's, iPhones, etc. However, none of my WIRED devices (Xbox, Printer, PC's) are connecting anymore. To be specific, none

  • Reg: Open items not showing in F-44

    HI all, I want clear open items using with f-44 but some of the open items are messing. i checked in FBL1N all open items are shwoing i want see all open items inf-44 how to see plz help me with regards JK Rao

  • Iphoto book in portugal

    I want to order an iphoto book in portugal. how can i do it? if it isn't possible yet, when is going to be available? thanks ESPIRITO