Dynamic image loading in a JPanel

Hi,
I've created a JFrame which includes a JPanel and would like to dynamically add images to the JPanel (for a space invaders game). I've been getting the JPanel graphics object casting to Graphics2D and then passing it to the Actor class constructor where the sprite is loaded as a BufferedImage and then called drawImage on the Graphics object but the sprite does not display. It's been suggested that I need to use a new JPanel for every sprite that gets loaded, but this would seem to be less efficient.
public class NewJFrame extends javax.swing.JFrame {
    public static NewJFrame root;
    public NewJFrame() {
        initComponents();
        root = this;
       Graphics2D g = (Graphics2D) jPanel1.getGraphics(); 
       new Actor(g);
public class Actor {
    public Actor(Graphics g){
        try {
        BufferedImage sprite = ImageIO.read(new File("/Users/administrator/Desktop/image.jpg"));
        g.drawImage(sprite, 0, 0, null);
        } catch (IOException e) { System.out.println(e);}
    }Thanks

The problem with doing it this way if I understand correctly is that if I overload the paintComponent method of the panel I'm trying to draw on this will be static i.e. you can't pass parameters (such as a the url of the graphic to load or number of graphics to load) to the paintComponent method (it only accept Graphics g as a parameter). In other words the panel can only be drawn on once.

Similar Messages

  • Problem using parameters in dynamic image loading

    Hello experts!!!
    I am using Crystal Reports 2008.  I am trying to make use of a class servlet application that returns an image based on a number of parameters.  I have put a formula behind a default image that should access the servlet and change the image at runtime.
    This works fine in the CR2008 designer.  However when it is published to my webapp, it doesn't work. 
    The problem is that for some reason, something somewhere is removing the '?' before the parameters in the URL.
    My formula
    "http://localhost:8080/demoMYSQL/servlet/em.cabbench.CabBenchSrv?requestType=getStaticDrawing&imageType=2D&scale=1.6&layerscale3d=0.03&extrusionlength3d=0.4&corelabellevel=1&solid=1&topLevel=1&userid=admin&password=admin&design=" + {designHeader/header/headerAtt.design}
    Image loading in designer
    [http://farm4.static.flickr.com/3503/3179649422_ebd760fa61.jpg?v=0]
    Web application log showing correct path name /em.cabbench.CabBenchSrv to servlet and a succesful request
    /em.cabbench.CabBenchSrv
    1231497711203|10:41:51:203|/demoMYSQL|null|requestType=getStaticDrawing&design=MV-120-XLPE-001&layerscale3d=0.03&scale=1.6&imageType=2D&userid=admin&topLevel=1&solid=1&extrusionlength3d=0.4&corelabellevel=1
    10:41:51:218  binding session 872DB3467263966DC9D5CEBB645C8A5D
    Image loading in viewer - NOT WORKED, default image displayed
    [http://farm4.static.flickr.com/3126/3179649516_5df47fa7fd.jpg?v=0]
    Web application showing incorrect path name to servlet because '?' is missing - result = null request!
    /em.cabbench.CabBenchSrvrequestType=getStaticDrawing&design=MV-120-XLPE-001&imageType=2D&scale=1.6&layerscale3d=0.03&extrusionlength3d=0.4&corelabellevel=1&solid=1&topLevel=1&userid=admin&password=admin&design=MV-120-XLPE-001
    1231498144859|10:49:4:859|/demoMYSQL|null|requestType=null
    1231498144859|10:49:4:859|End of
    Has anybody got any ideas of what to do with the question mark and how to get the image to change properly?????? Like it is doing in the report designer!
    Best Regards
    Nick Hirst

    Hi Nick,
    Since, the issue you have is with the web app only, I would request you to post this thread on the Dev Forum.
    Please click on the appropriate link below: -
    For .Net - SAP Crystal Reports, version for Visual Studio
    For Java - SAP Crystal Reports, version for Eclipse
    The people there would be the perfect people to help you with this.
    Hope this helps.
    Regards,
    Jay.

  • Dynamic image load with MovieClipLoader

    I'm trying to load five images from five URLs. If I use the
    documentation exactly as is, it works fine. Problem is, I don't
    want to createEmptyMovieClip, I want to use an existing one that's
    tucked inside a movie instance. Also, the images coming in are of
    unknown size, but have a standard 4:3 size ratio. I'd also like to
    scale them down to 180x120 after they arrive. Any help would be
    greatly appreciated.
    The code below only loads one image (which isn't working). I
    will eventually need it to load five different images.

    Dynamic text that doesn't have embedded fonts won't respond
    to tweening, alpha, etc. So you need to embed the font(s). There
    are a couple of ways to do this depending upon what you are doing.
    But most likely you can just select the text field and click the
    font button on the properties panel and select embed. Also I would
    recommend that you use _visible=false instead of alpha for this
    effect.
    I'm not sure what the second go-round is. Can you explain
    that a bit better? You should be able to use the same loader, so
    I'm not quite sure what is going on. Again, look for some helpful
    places to put some traces and see if you can figure out what is
    going on. Remember that generally Flash does what we tell it, not
    what we want! So if you can find the places where you are telling
    it to do things you can figure out what is happening.
    Also I'm not clear on what is going on with the variables and
    text. Generally I would recommend against using the variable
    property of text fields. That is a leftover from the Flash 5 days
    when you couldn't work directly with dynamic text fields. Instead
    give the fields instance names and then assign the text with the
    text property.
    myTextField.text="some value in here";
    myTextField2.text=someStringVariable;

  • Applying filter to images loaded with movieClipLoader

    Hello,
    I am building a product gallery and have a number of rather
    large bitmap images that I am loading with movieClipLoader. I need
    to apply drop shadow filters to them when they are loaded. I have
    tried several methods of going about this without success. One
    method was putting the loaded images into a movie clip with
    createEmptyMovieClip, and then applying the filter dynamically, but
    I couldn't seem to get it to work- the filter never appeared. I
    then tried applying the filter to the bitmap itself with
    bitMapData, but because I was not loading the bitmaps using
    bitMapData itself (I think) I wasn't able to get that method to
    work either.
    Does anyone have a suggestion or a recommendation for me?
    Thanks very much for any advice.

    Were you doing it after the onLoadInit event in the
    MovieClipLoader's listener?
    Try doing it that way if you haven't. One option I use for
    dynamic image loading is to create and empty holder clip - use that
    for placement and create another empty clip inside that one that I
    use as the loading target... I think this should work if you set
    the filter at the level of the first 'empty' clip. I had to use
    this approach a number of times because I was using a tweening
    engine based on movieclip prototype extensions (old hat I know) and
    loading new images kicked out the extended functionality from the
    clip the images are loaded into. That doesn't happen to the clip's
    parent... hence I think it might work also for what you want to do.
    Another thing to watch for is that you can't do bitmapData
    copies of images from a different domain unless you have
    crossdomain policy support - you can set it up so this works. I'm
    not sure if this affects filters though.
    -GWD

  • Button to load dynamic image in interactive form webdynpro for java

    Hi all
    i tried to use image field to load dynamic image as shown in the online interactive form tutorial
    and it worked for test but when try it with view appears inside viewset it doesnt....
    so i think if we could call the image after render by pressing a button inside the form it may work
    but the problem is i have no idea about how to implement such solution ,so if any one has any idea about how to implement such solution i will be thankful if he can share me the solution.
    thanks.....
    Naguib..

    use the following tutorial. it is very easy to follow and it works fine, i have tried that.
    http://www.docstoc.com/docs/2540673/How-To-Integrate-ADOBE-form-on-WebdynPro-for-ABAP-and-Deploy-it-
    in case of some more problems, ask again and point out the part of tutorial where there is a problem.

  • Adding "loading" movieclip to dynamic image gallery?

    Hello again,
    I've completed my XML-driven image gallery, however upon live testing I'd realized I made a rookie mistake and not put some kind of placeholder "loading" movie clip loop while the thumbnails—and subsequent full-size images—are being loaded. The images will randomly appear when loaded and I would like to be able to insert a placeholder movie clip while they load, and swap them up with the thumbnails/images after it has been loaded. The placeholder movie clip is in my library (loadingLoop), but I'm having problems getting it to work correctly.
    Below is the original function that processes the XML and adds the thumbnail images; this is where I'm trying to insert the placeholder movie clip per XML child node (every attempt I've made just keeps throwing more errors, so I've omitted my attempts to avoid confusion), and I've attached the XML file for testing. And insight or help would be appreciated.
    //Locate the external XML file and trigger xmlLoaded when complete
    xmlLoader.load(new URLRequest("data/artGallery.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    //Load the XML and process the image locations
    function xmlLoaded(event:Event):void {
        xml = XML(event.target.data);
        //parse the nodes in the XML file
        xmlList = xml.children();
        //count the number of nodes in the XML file via XMLList
        trace(xmlList.length());
        //loop to load all of the thumbnails, based on the number of nodes in XMLList
        //"i" = every child node in the XML file
        for (var i:int = 0; i < xmlList.length(); i++) {
            //Add loadingLoop movie clip per node and wait for thumnail to load before swapping out with imageLoader thumbnail images <-- help!!
            //for every node, create a new instance to be put on stage
            imageLoader = new Loader();
            //load each thumbnail from its location per XML node's "thumb" attribute
            imageLoader.load(new URLRequest(xmlList[i].attribute("thumb")));
            //position of thumbnail instances per XML node (horizontally across stage)
            imageLoader.x = i * 110 + 10;//thumbs are 100 x 100 so, +10 to the width, plus +10 from left edge
            //imageLoader.y = 10;
            //for each node in XML list, name the instance with the path to the location of the full size image
            imageLoader.name = xmlList[i].attribute("source");
            //for each node in the XML list, add a drop shadow
            imageLoader.filters = [thumbDShadow];
            //add thumbnails to stage
            addChild(imageLoader);
            dropTween = new Tween(imageLoader, "y", Bounce.easeOut, -100, 10, 1, true);
            //set up thumbnails to wait for a click to execute showPicture
            imageLoader.addEventListener(MouseEvent.CLICK, showPicture);
            //set up thumbnails to scale when rolled over
            imageLoader.addEventListener(MouseEvent.ROLL_OVER, sizeUP);

    Somehow I had a feeling this wouldn't be a copy-and-paste job for the full-size images. Sorry to be a bother. This is the showPicture function that is fired off when the thumbnail image is clicked (from our previous example). Two errors are thrown:
    When the thumnail is clicked:
    "Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/removeChild()
        at MethodInfo-51()"
    But the full-size image loads nonetheless. The second loading loop (loadingLoop2) is not removed. Below is the showPicture function:
    //Load the full-size images and place onto the stage
    function showPicture(event:MouseEvent):void {
        //add new movie clip container
        var mc2:MovieClip = new MovieClip();
        addChild(mc2);
        //clear the fullLoader—this is to help clear any full-size images that may already be on the stage (they have two options, click a new thumbnail, or close the current full-size image
        fullLoader.unload();
        //re-create the fullLoader, if there was one cleared
        fullLoader = new Loader();
        //load each full size image from its location per XML node's "source" deliniated by mc.ldr's "source" attribute
        fullLoader.load(new URLRequest(event.target.name));
        //add the loder to the container
        mc2.addChild(fullLoader);
        //create new instance of second loading loop
        mc2.fsloop = new loadingLoop2();
        //add the second loading loop to the container
        mc2.addChild(mc2.fsloop);
        //for each container, add a drop shadow
        mc2.filters = [fullDShadow];
        //set the container's position center on stage, making it the size of the loading loop until the full-size images are loaded
        mc2.x = (stage.stageWidth - mc2.fsloop.width) * 0.5;
        mc2.y = (stage.stageHeight - mc2.fsloop.height) * 0.5;
        //place container on stage
        addChild(mc2);
        //fade in each container
        fadeTween = new Tween(mc2, "alpha", None.easeNone, 0, 1, 0.5, true);
        //check to see if the image has been loaded completely—this is to make sure the image's attributes can be used to re-center on stage and remove fsloop
        fullLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, removeLoop2);
        //set field to multiline so that the <br> HTML tags can be used
        imageTextField.multiline = true;
        //add text frame for description
        imageTextField.x = 10;
        imageTextField.y = 125;
        //for each full-size image, load the description text from the XML child nodes
        for (var j:int = 0; j < xmlList.length(); j++) {
            //check to make sure that the correct full-size image matches the text node when clicked
            if (xmlList[j].attribute("source") == event.target.name) {
                //add each child node as a separate line in the same text field; added HTML tags for CSS application
                imageTextField.htmlText = "<p><span class = 'projectName'>" + xmlList[j].child("projectName") + "</span><br>"
                + "<span class = 'toolsUsed'>" + xmlList[j].child("toolsUsed") + "</span><br><br>"
                + xmlList[j].child("projText") + "<br>"
                + "<span class = 'liveURL'>" + xmlList[j].child("liveURL") + "</span></p>";
        function removeLoop2(event:Event):void {
            //re-position the container to center on stage to accomodating the full sized image
            mc2.x = (stage.stageWidth - fullLoader.width) * 0.5;
            mc2.y = (stage.stageHeight - fullLoader.height) * 0.5;
            //Add the text field
            addText();
            //hide instructional text, already on stage
            galleryInfo_mc.alpha = 0;
            //remove the full-sized loading loop
            event.target.loader.parent.removeChild(MovieClip(event.target.loader.parent).loadingLoop2 );
        //set up full-size images to "self close" by clicking on it
        mc2.addEventListener(MouseEvent.CLICK, clearStage);
    The second error gets thrown when the container is clicked and the function clearStage is executed, which does not remove the container:
    "TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/removeChild()
        at artGallery_v1_5_fla::MainTimeline/clearStage()"
    This is the clearStage function:
    //Allow full-size image to "self close" by clikcing on it and removing the text description
    function clearStage(event:MouseEvent):void {
        //clear the fullLoader
        fullLoader.unload();
        //remove the container
        event.target.parent.removeChild(MovieClip(event.target.parent).mc2);
       //remove the text field
        removeChild(imageTextField);
        //show the instructional text that is on-stage
        galleryInfo_mc.alpha = 1;
    Help!

  • Dynamic image in the template builder plug-in does not work

    Hi all,
    The documentation says:
    Direct Insertion
    Insert the jpg, gif, or png image directly in your template.
    +...This works obviously+
    URL Reference
    1. Insert a dummy image in your template.
    2. In Microsoft Word's Format Picture dialog box select the Web tab. Enter the following syntax in the Alternative text region to reference the image URL:
    url:{'http://image location'}
    For example, enter: url:{'http://www.oracle.com/images/ora_log.gif'}
    +...This works too when I hardcode an url as url:{'http://www.google.com.tr/images/firefox/mobiledownload.png'}+
    Element Reference from XML File
    1. Insert a dummy image in your template.
    2. In Microsoft Word's Format Picture dialog box select the Web tab. Enter the following syntax in the Alternative text region to reference the image URL:
    url:{IMAGE_LOCATION}
    where IMAGE_LOCATION is an element from your XML file that holds the full URL to the image.
    +...This, however, does not work.+
    I use Apex' report query tool and My query is like
    select 'http://www.google.com.tr/images/firefox/mobiledownload.png' IMAGE_LOCATION from ... (a single result set for my template)
    the xml data is generated with an IMAGE_LOCATION tag. I load it to word template plug-in. The Url successfully displays in the report if I make it a plain-simple field.
    But when it's in the image format->web->alt text as url:{IMAGE_LOCATION} no image displayed.
    I need to keep this design procedure simple so a simple word user could design a report via using just template builder plug-in. I don't wish to explore the xsl-fo area...yet.
    Could you tell me why I can't get this url:{IMAGE_LOCATION} to work?
    Regards
    PS: My BI version: 10.1.3.4.1
    Edited by: oeren on Jun 8, 2011 12:28 AM

    Oeren,
    I stumbled across this little tidbit buried in the BI Publisher forum: Dynamic Images in rtf
    Glad you are up and running!
    Joshua

  • Dynamic Image Displays Blank When Using In Visual Studio Project

    I am trying to simply display a dynamic image in a report. I am using Crystal Reports XI Release 2.
    I have two different environments: Local via Progress where reports are called using Crystal Viewer ActiveX, and over the web where reports are called from Open Laszlo and Visual Studio project.
    The image is set to a blank image as default, and Graphic Location Forumla loads the image from the database (site.logo_location + site.logo_filename) which results in an image http:
    www.vetinfo3.com\a.jpg.
    When I run the reports locally using the ActiveX control, it works just fine and displays the image.
    When I run over the web using OpenLaszlo, it displays a blank.
    Troubleshooting
    We are using Visual Studio 2005, which is bundled with an older version of Crystal that doesn't support dynamic images.
    To address this, I loaded Crystal XI Release 2, which updated the version in Visual Studio and enabled the Graphic Location formula field on the dev machine.
    I verified the Graphic Location field was set correctly.
    This caused a Version error, so we loaded cr_net_2005_mm_mlb_x86.zip on server and specified the Version in web.Config.
    No errors now, but when I build and publish the code, the image still displays as blank.
                From Fiddler
                   GET http://www.vetinfo3.com/mdsol1/CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_c5d6a923-293b-4f1e-8739-4e698f83b087.png
                   Creates C:\Documents and Settings\Curtis\Local Settings\Temporary Internet Files\Content.IE5\PWRUX2XW\CrystalImageHandler[1].png
                   Blank Image
    According to issues within Visual Studio, they say the fix to this is to add the <httpHandler> in web.Config, but it is already there; added when we add the viewer to the project:
    In web.Config I have some questions about this line:
        <httpHandlers>
          <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        </httpHandlers>
    There are more service packs for Crystal XI Release 2:
    crXIr2sp2_net_server_install.zip
    crXIr2sp3_net_server_install.zip
    crXIr2sp4_net_server_install.zip
    I have not loaded these yet, but the readme files do not indicate they fix any dynamic image issues.
    I am out of ideas on this; does anyone have any ideas?

    What about if you take OpenLaszlo out of the picture? E.g.; use one of our samples from here;
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    I'd recommend vbnet_web_simplepreviewreport
    Also, see [this|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0437ea8-97d2-2b10-2795-c202a76a5e80] article.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • Dynamic Images in Crystal Reports

    I have a report with Dynamic Images. I am able to run the report but once I try to export it or try to browse through the pages I get the following error:
    Application popup: Crystal Reports - [Inventory Graphics Report.rpt]: crw32.exe - Application Error : The exception Integer division by zero.
    (0xc0000094) occurred in the application at location 0x2c03a410.

    Hi Don,
    I have read your response 10 times, but I don't really understand it.
    "Your only option is to use the Insert OLE Object or picture into the report" - fine, but how is this achieved from a dataset?
    "CR will not display BLOB fields as pictures" - fine, but maybe I used the word BLOB badly. The dataset column datatype is "byte[]". Will CR display byte[] columns as pictures?
    "You can use a database field to point to which picture file to use, then you won't be using up valuable memory space importing the images into your data set. And the Logo's now dynamic...." - this seems to suggest that the database field is a string storing the file location on disk. Yes? I don't care about memory space in this case and I'm happy to load a binary file into a byte[] column if there is a way of displaying it.
    So, if I understand correctly, you're suggesting the dataset contain a table.row.column which stores the filelocation. How do I convert that to display as a picture (dynamically)?
    Robert

  • Dynamic Images in PDF and Escaping Special Characters

    I used the following to create my own PDFs with dymnamic images:
    http://marcsewtz.blogspot.com/2012_02_01_archive.html (Dynamic Images in PDF - What 32k Limit? )
    I have installed this application on Oracle's free workspace to test.
    The issue I am having is that when there is a special character in the description, such as <>'"& then the the PDF will not open. I have tried using the dmbs_xmlgen.convert to convert the description but haven't had any luck.
    I'm a complete novice with xml. Any help with this is greatly appreciated.
    Thanks,
    Glen

    I have been able to find a solution, but it's not completely perfect. I have changed the "description" field as follows:
    XMLCdata(replace(description,''&'',''and'')) description,
    The characters greater than (>), less than (<), single qoute('), and double quote (") can now all be in the description and will not cause errors. For some reason, I couldn't get the & not to give an error no matter what I tried, so I just replaced the & with the word "and". This solution will work for my needs, but it would be nice to be able to get the & to display.
    Does anyone know of a way to get the & to display correctly?
    Thanks again,
    Glen
    The complete code I am using is below:
    declare
    l_print_layout clob;
    l_xml_data clob;
    begin
    -- load print layout from database
    for c1 in (
    select layout from eba_pdfimg_layouts where id = :P1_LAYOUT
    ) loop
    l_print_layout := wwv_flow_utilities.blob_to_clob(c1.layout );
    end loop;
    -- generate XML data
    for c2 in (
    select dbms_xmlgen.getxml('
    select
    id,
    file_name,
    mime_type,
    XMLCdata(replace(description,''&'',''and'')) description,
    -- description,
    blob2clobase64(image,''Y'') image
    from eba_pdfimg_images
    ') xml_data from dual
    ) loop
    l_xml_data := c2.xml_data;
    end loop;
    -- download print document
    wwv_flow.g_page_text_generated := true;
    apex_util.download_print_document (
    p_file_name => 'image_demo',
    p_content_disposition => 'ATTACHMENT',
    p_report_data => l_xml_data ,
    p_report_layout => l_print_layout,
    p_report_layout_type => 'rtf',
    p_document_format => :P1_FORMAT
    end;

  • Dynamic Image Gallery Issue

    Hello All!
    I am creating a dynamic image gallery, but when my external
    images load in the empty movie clip, all the images are loading in
    the same size/dimension. Does anyone know how I can command the MC
    to load the images in different sizes, another words - to load them
    according to its own size?
    here's the AS
    onClipEvent (load)
    function imageMove()
    var _loc1 = this;
    for (i = 1; i <= num_of_image; i++)
    mc = _loc1["image" + i];
    if (i < hit)
    tempx = small * (i - 1) + 30;
    temps = small - 5;
    mc.useHandCursor = true;
    else if (i > hit)
    tempx = big + small * (i - 2) + 30;
    temps = small - 5;
    mc.useHandCursor = true;
    else
    tempx = small * (i - 1) + 150; //distance of how far out the
    displayed image jumps.
    temps = big - 5; //distance between the displayed image and
    thumbnails.
    mc.swapDepths(1000);
    display = txt
    mc.useHandCursor = false;
    } // end else if
    mc._x = mc._x + (tempx - mc._x) / 3; //number of pixals on
    x-axis the displayed image moves over to right side before growing
    big.
    mc._width = mc._width + (temps - mc._width) / 3; //number of
    pixals on x-axis the displayed image moves over to left side before
    growing big.
    mc._height = mc._width * 4 / 3;
    if (Math.abs(mc._width - temps) <= 1)
    title._x = hit < 5 ? (_loc1["image" + hit]._x + big / 2) :
    (_loc1["image" + hit]._x - big / 2 - 100);
    title._y = 100;
    } // end if
    } // end of for
    } // End of the function
    function loopHye()
    if (hit != num_of_image)
    ++_global.hit;
    else
    _global.hit = 1;
    } // end else if
    } // End of the function
    getURL("FSCommand:allowscale", false);
    big = 300;
    //Large image width (400 works best for my portfolio site)
    small = 60;//Small image width (40 works well for my
    portfolio site)
    num_of_image = 8;//Total number of images
    timeGap = none;//Speed (speed of gaptime when each image is
    displayed automatically. "2000" is default of this original file.
    larger the number the slower the image changes. (type in "none"
    will stop automatic images from changing.
    _global.hit = 0;//First displyed image number (type "0" to
    stop images from growing out)
    txt = [" ", "image1", "image2", "image3", "image4", "image5",
    "image6", "image7", "image8"];//insert text of each images between
    for (i = 1; i <= num_of_image; i++)
    attachMovie("image", "image" + i, i);
    loadMovie("image/" + i + ".jpg", this["image" +
    i].tar);//image folder path
    mc = this["image" + i];
    mc._x = small * (i - 1) + 30;
    mc._y = 200; //where on the axis should the displays be.
    mc._width = small - 5;
    mc._height = mc._width * 4 / 3;
    this["image" + i].onRelease = function ()
    clearInterval(interval);
    _global.hit = this._name.substr(5);
    interval = setInterval(loopHye, timeGap);
    } // end of for
    interval = setInterval(loopHye, timeGap);
    onClipEvent (enterFrame)
    imageMove();
    check out the file
    http://www.wendiland.com/Gallery122b.fla
    this is what the current gallery looks like
    http://www.wendiland.com/print2.html
    I'd appreciated if someone replies with any sort of
    suggestions! thanks in advance!!!
    - W£NDI

    if you google with "dynamic image gallery", you'll find a lot
    of
    tutorials & examples including pre-programmed solutions
    if you prefer to do it yourself, you need to deal with
    dynamic sites. DW
    help chapters Preparing to Build Dynamic Sites, Making Pages
    Dynamic &
    Developing Applications Rapidly can also help to understand
    in fact you don't need a database, the images can be read
    from the
    folder they're stored. that way to update a gallery you only
    need to
    remove/replace/add images. one folder for each gallery
    and the application development forum is best suited for your
    question
    BTW, some nice photos in your page
    hth,
    jdoe
    uvi wrote:
    > I'm trying to create a dynamic image gallery that is
    updated from a database, i
    > managed to create a simple mysql database
    > using phpmy admin, so I could update my image gallery
    more often, I saw
    > something that I like but I have no idea how to create
    it here is the example:
    >
    http://flight001.com/store/trip.htm?itemid=307&sid=201&page=2
    > I didnt manage to create this with dynamic table from
    within dreamweaver 8,
    > maybe I just don't know how,
    > this is the link to a gallery on my website:
    >
    http://www.yuvallavy.com/work/scenic/scenic.htm.
    I need all the help I can get
    > I'm using dreamweaver 8 on a Mac and using PHP/MySql
    server model.
    >

  • Dynamic image in header

    Hello,
    I've been starting to use Livecycle designer (version 8 it seems) a few weeks ago and I am currently confronted to a problem that I can't to solve.
    Basically, I need to create a Fragment that serves as a header for multiple documents.
    This Fragment contains an image field that changes depending on certain values on my form and of course, being a header, it is placed in the master page.
    Now, for some reason,the fragment works if my it is placed in the main page, but doesn't display any image if I place it in my master page.
    I have been using the following code to load the image:
    imageField.value.image.href = "../Pictures/myPicture.png";
    Alternatively, I have also tried to use a dynamic image field with the same code, and although it displays the picture in Designer (even when in the masterpage), the pdf is "corrupted" when I load it from Livecycle.
    Am I taking the wrong approach here? Is there anything that I can do?
    Thank you for any light you can shed on the matter.

    Hi,
    Don't have a complete answer, but you might get some indication for working with images here: http://assure.ly/mcFrC6.
    You should also have a look at John Brinkman's post: http://blogs.adobe.com/formfeed/2009/11/linked_vs_embedded_template_im.html.
    If you are using an ImageField object on the Master Page you might need to set its binding to Global. So that as new pages are rendered on the form, the image will be displayed.
    In relation to the href, I believe that you are hitting a security restriction.
    I am not sure how best to get the image in from LiveCycle, maybe someone else will have a better view.
    Good luck,
    Niall

  • Xpath for dynamic image update

    I am trying to get the image from the Astronomy Photo of the
    Day APOD website to display on our college departments Astronomy
    web page. I just need to display the image and not the whole page.
    As I was searching for ways to scrape dynamic images I came
    across the ability for Firebug to extract the xpath from any block
    of html. In the case of apod the xpath for image is this:
    /html/body/center/p[2]/a/img
    Could I use Spry to display the image of the day using xpath
    or is the wrong way to accomplish this?

    after loading an image you can get its contentWidth and
    contentHeight, with this you then calculate the aspect ratio and
    resize your container accordingly so that there is no white space.
    i.e
    MyImg.addEventListener(Event.COMPLETE,UpdateContainer)
    private function UpdateContainer(e:Event):void
    var AspectRatio : Number =
    MyImg.contentWidth/MyImage.contentHeight;
    MyContainer.width = MyContainer.height*AspectRatio;
    MyImg.width = MyContainer.width;
    MyImg.height=MyContainer.height;
    MyContainer.addChild(MyImg);
    the assumption here is you are basing the container height as
    the fixed constant obviously you can set width as the fixed
    constant and adjust height by aspect ratio

  • Dynamic Image Gallery AS2

    I have dipped in almost every search engine and this site to
    locate some easier way to create dynamic image gallery in Flash 8
    AS2 using ASP (as i am conversant with ASP only, although i found
    many sites suggesting PHP and XML). I'd be very greatful to u all
    if u could provide me some help in this part of my project.
    I have tried this source also but neither the source throw
    any error nor it displays the images, what could be wrong with the
    source? Please Please Please Please Please Help me!!!!!!!!
    this.createClassObject(mx.containers.ScrollPane,
    "scroller_sp", 10);
    scroller_sp. setSize (100, 300);
    swfThumbs=["imgs/img1.jpg","imgs/img2.jpg","imgs/img3.jpg"]
    this.createEmptyMovieClip("clipLoader",1);
    for(i=0;i< swfThumbs.length;i++){
    clipLoader.createEmptyMovieClip("clip"+i+"_mc",i)
    clipLoader.attachMovie("clip"+i+"_mc","clip"+i+"_mc",i+10);
    clipLoader.loadMovieNum(swfThumbs
    ,i+100);
    scroller_sp.contentPath = clipLoader;
    thanks in anticipation and regards
    raajaindra

    Hi,
    I have a picture show.
    It creates its own folder when you first upload images with
    the integrated Image uploader. Then it loads the images in with
    ASP.
    Have a look at
    http://netwings.info
    - click the B1 Image-show.
    When you are interested, the contact is at the site.
    Regards,
    Luciewong

  • Dynamic Photo Load Lag

    Hello,
    I am trying to dynamically populate a cube ad with photos and text from a json file.  The fields that are populated are photo, title, desc and price.  When I initially created the ad I had a photo and 3 text fields.  After a 5 second animation, the count would increase by 1 and all fields would be repopulated.  When I tested this the text worked perfectly but there was a lag in the photo switch.  My solution was to create a second set of fields to run the following way:
    Slide A (visible): Photo, Title, Desc, Price
    Slide B (hidden): populated with the next Photo, Title Desc, Price
    5 second animation, then switch
    Slide B (Visible)
    Slide A (hidden) repopulated with the next Photo, Title, Desc, Price
    5 second animation, then switch
    Loop back to the top...
    This set-up works through the first run through but then the photo starts lagging again.
    Can anyone help me solve the lag issue?  Below is my compositionReady stage code. I will also include a zip of my project.  I moved Slide B 300px to the right and took out the hide functions so I could see what was happening behind the scenes.  I also included some helper text fields to show what functions are being called while it is running.
    compositionReady Code:
    //Variable
    imageCount =     0;
    //JSON
    $.getJSON("slides.json", function(data){
        loadDataA(imageCount);
        // Load Data A
        function loadDataA(i) {
        sym.$("notification1").html("loadDataA");
            sym.$("photo").empty();
            sym.$("photo").attr("src", data[i].image);
            // Populate text A
            sym.$("title").html(data[i].title);
            sym.$("desc").html(data[i].desc);
            sym.$("price").html(data[i].price);
            sym.$("notification5").html("photo image = " + data[i].image);
        // Load Data B
        function loadDataB(i) {
        sym.$("notification1").html("loadDataB");
            sym.$("photo2").empty();
            sym.$("photo2").attr("src", data[i].image);
            // Populate text A
            sym.$("title2").html(data[i].title);
            sym.$("desc2").html(data[i].desc);
            sym.$("price2").html(data[i].price);
            sym.$("notification6").html("photo2 image = " + data[i].image);
        function hideAshowB() {
        sym.$("notification2").html("hideAshowB");
             sym.$("photo").empty();
            //sym.$("photo").hide();
            //sym.$("title").hide();
            //sym.$("desc").hide();
            //sym.$("price").hide();
            sym.$("photo2").show();
            sym.$("title2").show();
            sym.$("desc2").show();
            sym.$("price2").show();
        function hideBshowA() {
        sym.$("notification2").html("hideBshowA");
            sym.$("photo2").empty();
            //sym.$("photo2").hide();
            //sym.$("title2").hide();
            //sym.$("desc2").hide();
            //sym.$("price2").hide();
            sym.$("photo").show();
            sym.$("title").show();
            sym.$("desc").show();
            sym.$("price").show();
          function animateSlideshowA() {
          sym.$("notification3").html("animateSlideshowA");
            sym.$("title").animate({x: 9}, 5000, function() {
            sym.$("notification4").html("insideSlideshowALoop");
                        imageCount++;
                        if (imageCount >= data.length) {
                            imageCount = 0;
                        loadDataA(imageCount);                  
                        hideAshowB();                   
                        animateSlideshowB();
          function animateSlideshowB() {
          sym.$("notification3").html("animateSlideshowB");
            sym.$("title2").animate({x: 309}, 5000, function() {
            sym.$("notification4").html("insideSlideshowBLoop");
                        imageCount++;
                        if (imageCount >= data.length) {
                            imageCount = 0;
                        loadDataB(imageCount);
                        hideBshowA();                 
                        animateSlideshowA();
        loadDataA(imageCount);
            imageCount++;
            loadDataB(imageCount);
            animateSlideshowA();
    www.capitalpress.biz/html5ads/cubes/nyssatractor/NyssaDynamicTest.zip
    Thanks for your help,
    Brandon

    Hi,
    So, here is an Edge solution using a symbol ("animateAds"). Basic approach is to create a collection and browse it.
    Collections are:
    a) the json file.
    b) sym.createChildSymbol("animateAds","slider") ==> it creates your ads collection.
    c) sym.getChildSymbols() ==> it returns the ads collection created by 2).
    I also use a global variable ( sym.setVariable("index") ) to play each ad. So: a counter.
    1) Creating the symbol:
    2) Animating the symbol (one ad):
    ==> the demo file to download: Nyssa.zip - Box
    It's an infinite loop. You can add events (click, swipe).
    Note: i change the json file to browse an object.
    At last but not least: i tested on Apple (OS X Mavericks and iOS 7.1.2) and on Microsoft (Windows 8.1 update 04/18 with IE 9,10,11).
    Ask me if you don't understand code. 2 main steps: creating ads (panel: creationComplete) and playing ads (trigger panels: at 0 and 5000).

Maybe you are looking for