Need help displaying image on canvas  :((

can anybody help me with my coding. my problem is, i cannot display an image on my canvas. plz..someone help me to solve my problem..
Here's my coding...
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
import java.util.*;
public class ImageMidletServlet
    Display display = null;
    //Form f = null;
    String url = "http://localhost:8080/banner/hp0.gif";
    String url2 = "http://localhost:8080/banner/rotateNumber";      
    //String url = "http://localhost:8080/banner/banner";
    Command backCommand = new Command("Back", Command.BACK, 0);
    Command submitCommand = new Command("Submit", Command.OK, 2);
    Command exitCommand = new Command("Exit", Command.STOP, 3);
    private Test test;  
    private StringItem stringItem2;
    private TextField txtField;
    private Timer tm;          // Timer
    private load load;       // Task
    private int id = 0;
    Image img = null;
    //String id;
    public ImageMidletServlet(Display display)
        this.display=display;  
        loadimage();
    public void loadimage()
        tm = new Timer();
        load = new load();
        tm.schedule(load,0,6000);
     class Test extends Canvas implements Runnable, CommandListener
        private Canvas canvas;
        public Test(Canvas canvas)
            this.canvas=canvas;
            setCommandListener(this);
        public void start()
            Thread t = new Thread(this);
            t.start();
        public void run ()
            DataInputStream is = null;
            DataInputStream is2 = null;
            StringBuffer sb = new StringBuffer();
            Image img= null;
            TextBox txtBox = null;
            StringBuffer b = new StringBuffer();
            HttpConnection c2 = null;
            OutputStream os = null;           
            ++ id;
            try
                c2 = (HttpConnection)Connector.open(url2+ "?bannerid="+id);
                os = c2.openOutputStream();
                os.write(("bannerid="+id).getBytes());              
                os.flush();
                //HttpConnection c = (HttpConnection) Connector.open(url+ "?bannerid="+id);
                HttpConnection c = (HttpConnection) Connector.open(url);
                int len = (int)c.getLength();
                if (len > 0)
                    is = c.openDataInputStream();
                    byte[] data = new byte[len];
                    is.readFully(data);
                    is2 = c2.openDataInputStream();
                    int ch;
                    while ((ch = is2.read()) != -1) {
                    b.append((char) ch);
                    System.out.print((char)ch);
                    try {
                    //img = Image.createImage(data, 0, len);
                    img = Image.createImage("/images/splash.png");
                    Graphics graphics = img.getGraphics();                   
                    catch (Exception e)
                    if(img==null)
                    System.out.print("no image");
                    else {System.out.print("got image");}
                else
                    showAlert("length is null");;
                is.close();
                c.close();
                c2.close();
               // repaint();
            catch (Exception e)
                e.printStackTrace();
                showAlert(e.getMessage());
        /* Display Error On screen*/
        private void showAlert(String err)
            Alert a = new Alert("");
            a.setString(err);
            a.setTimeout(Alert.FOREVER);
            display.setCurrent(a);
         public void commandAction(Command c, Displayable d)
        if (c == exitCommand)
            //destroyApp(true);
            //notifyDestroyed();
        else if (c == backCommand)
            //display.setCurrent(f);
        else if (c == submitCommand)
            /*test  = new Test(this);
            test.start();*/
         protected void paint(Graphics graphics)
         if (img != null)
            graphics.setColor(0x000000);  
            graphics.drawImage(img, 0, 0, Graphics.TOP | Graphics.HCENTER);
         else
         {System.out.print("no drawing");}
    class load extends TimerTask
    private Test canvas;
       public final void run()
      this.canvas = canvas;
      test  = new Test(canvas);
      //test();
      test.start();
}

Hi
I would do like this: take the code that draws the image an put it into a separate class (which will extend the Canvas class) which will take as a parameter to its constructor either an array of bytes or an Image object (it's up to you) and call this class after you have downloaded all the bytes from the input stream. I presume that you get the "no drawing" message..
Mihai

Similar Messages

  • Need help displaying images with List component for Flash CS4 (ActionScript 3.0)

    Hi folks:
    I am an inexperienced user of Flash CS4 Pro (v10.0.2). I am attempting to use the List component with ActionScript 3.0 to make a different image display when a user clicks each item in a list.
    I did find a tutorial that showed me how to make different text display using a dynamic text box and the following ActionScript:
    MyList.addEventListener(Event.CHANGE, ShowSelectedItem);
    function ShowSelectedItem(event:Event):void {
        ListText.text=MyList.selectedItem.data;
    ...where My List is the instance of the List component and ListText is the dynamix text box. In this case, the user clicks an item in the list, defined by the label value in the dataProvider parameter of the List component, and text displays as defined in the data value in the dataProvider parameter.
    However, as I mentioned to start, what I really want to do is make images display instead of text. Can anyone provide me the steps to do this?
    I appreciate your help (in advance)!!
    Cindy

    Hi...thanks for responding! I was planning on using images from the Library, but if there is a better way to do it, I'm open. So far, I just have text in the data property. This is part of my problem. I don't know what I need to put in the data value for an image to display. Do I just put the image file name and Flash will know to pull it from the Library? Do I need to place the images on the stage on different frames? I apologize for the "stupid user" questions, but as you can tell, I'm a newbie.
    Appreciate your patience and any help you can offer!
    Cindy

  • Displaying images in canvas one after another

    Hi all,
    I have a problem displaying images in canvas one after another. I am using for loop and when i run the application, all images run back in the and only finally only the last image gets displayed in the emulator. I also used thread.sleep(). But it din't work.
    Here is my code:
    // A canvas that illustrates image drawing
    class DrawImageCanvas extends Canvas
    Image image;
    public void paint(Graphics g)
    int width = getWidth();
    int height = getHeight();
    g.setColor(0);
    g.fillRect(0, 0, width, height);
    String images[]={"paint_2.PNG","radha.PNG","cute.png","design.png","flowers.png"};
    for(int i=0;i<images.length;i++)
    image = null;
    System.out.println("/"+images);
         try
         image = Image.createImage("/"+images[i]);
    catch (IOException ex)
    System.out.println(ex);
    g.setColor(0xffffff);
    g.drawString("Failed to load image!", 0, 0, Graphics.TOP | Graphics.LEFT);
    return;
    if (image != null)
    g.drawImage(image, width/2, height/2, Graphics.VCENTER | Graphics.HCENTER);
    try
    Thread.sleep(5000);
    catch(Exception ex)
         System.out.println("the exception is.."+ex);
    Help me and Thanks in advance.

    See the code below : prefer the use of a Timer and a TimerTask instead of Thread.sleep().
    showNotify (from Canvas) is used to launch the timer.
    import java.io.IOException;
    import java.util.Timer;
    import java.util.TimerTask;
    import javax.microedition.lcdui.Canvas;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    public class DrawImage extends Canvas {
        Image image;
        String images[] = {"img1.png", "img2.png", "img3.png", "img4.png", "img5.png",
                            "img6.png", "img7.png"};
        Image[] tabImage;
        int imageCounter = 0;
        public DrawImage(){
            try {
                tabImage = new Image[images.length];
                for (int i = 0; i < images.length; i++)
                    tabImage[i] = Image.createImage("/" + images);
    } catch (IOException ex) {
    ex.printStackTrace();
    public void paint(Graphics g) {
    int width = getWidth();
    int height = getHeight();
    g.setColor(0);
    g.fillRect(0, 0, width, height);
    image = tabImage[imageCounter];
    if (image != null)
    g.drawImage(image, width / 2, height / 2, Graphics.VCENTER | Graphics.HCENTER);
    else{
    System.out.println("null");
    g.setColor(0xffffff);
    g.drawString("Failed to load image!", 0, 0, Graphics.TOP | Graphics.LEFT);
    protected void showNotify(){
    Timer t = new Timer();
    t.schedule(new PhotoSwitcher(), 5000, 5000);
    private class PhotoSwitcher extends TimerTask{
    public void run() {
    if (imageCounter < images.length - 1)
    imageCounter++;
    else
    imageCounter = 0;
    repaint();
    I hope this will help you !
    fetchy.
    Edited by: fetchy on 14 ao�t 2008 09:48                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • TS1314 Need help tranfering images to iphone...

    I need help tranfering images from my computer to my iphone. I've synced the images but they don't appear on my iphone, also on the file that contains the images, there's a file that says IPOD PHOTO CACHE. I don't know what to do. Please Help...

    Hope these help, do you not find them at all in the photos app?:
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPhoto '11: View photos or slideshows on iPod, iPhone, iPad, or Apple TV
    http://support.apple.com/kb/PH2437
    iTunes: Understanding the iPod Photo Cache folder
    http://support.apple.com/kb/TS1314
    ============================
    - Oz

  • Need help getting images for blog aggregator

    I need help trying to grab images into a blog aggregator...
    Here is the code that gets the image.
    <!--- Get thumbnail, if exists --->
    <cfset content_to_parse = temp_description_full>
    <cfinclude template="module_get_images.cfm">
    <cfif IsArray(image_array) AND ArrayLen(image_array)>
    <cfloop from=1 to=#ArrayLen(image_array)# index="j">
    <cfhttp url="#trim(image_array[j].link_url)#"
    method="get" throwonerror="No" timeout="15" getasbinary="Auto"
    resolveurl="No" />
    <cfif IsBinary(cfhttp.filecontent)>
    <cfset tmp_filename = "thumbnail_entry_" & GetID.id
    & "." & image_array[j].file_type>
    <cffile action="WRITE"
    file="#ExpandPath(request.base_relative_url &
    '/blog_thumbnails/' & variables.tmp_filename)#"
    output="#cfhttp.filecontent#">
    <cfset thumb_image = request.img.process_image(image_path
    = ExpandPath(request.base_relative_url & '/blog_thumbnails/'
    & variables.tmp_filename), max_width = 120, max_height = 120,
    crop_area = "center")>
    <cfimage source="#thumb_image#" action="write"
    destination="#ExpandPath(request.base_relative_url &
    '/blog_thumbnails/' & variables.tmp_filename)#"
    overwrite="yes">
    <cfquery name="UpdateEntry"
    datasource="#request.data_source#" username="#request.db_un#"
    password="#request.db_pw#">
    UPDATE aggregated_blog_entry
    SET aggregated_blog_entry_thumbnail_image_tx =
    '#left(variables.tmp_filename,255)#'
    WHERE aggregated_blog_entry_id = #GetID.id#
    </cfquery>
    <cfbreak>
    </cfif>
    </cfloop>
    </cfif>
    ---------This is the module_get_images.cfm
    code----------------
    <cfset start_pos = 1>
    <cfset image_array = ArrayNew(1)>
    <cfset regex_image = "<img[^>]*>">
    <cfset regex_image_url =
    "(((https?:|ftp:|gopher:)\/\/)|(www\.|ftp\.))[-[:alnum:]\?%,\.\/&##!;@:=\+~_]+[\-A-Za-z0- 9\/]">
    <cfloop condition="1">
    <cfset temp_image_pos = REFindNoCase(regex_image,
    variables.content_to_parse, start_pos, true)>
    <cfif temp_image_pos.pos[1]>
    <cfset temp_link =
    mid(variables.content_to_parse,temp_image_pos.pos[1],temp_image_pos.len[1])>
    <cfset link =
    REFindNoCase(regex_image_url,temp_link,1,1)>
    <cfif NOT link.pos[1]>
    <cfset temp_link_url = "">
    <cfelse>
    <cfset temp_link_url =
    mid(temp_link,link.pos[1],link.len[1])>
    </cfif>
    <!--- Don't show links to images --->
    <cfif len(trim(temp_link_url)) AND
    ListFindNoCase("jpg,jpeg,gif,bmp,png",left(ListLast(temp_link_url,"."),3))>
    <cfset image_array[ArrayLen(image_array)+1] =
    StructNew()>
    <cfset image_array[ArrayLen(image_array)].link =
    temp_link>
    <cfset image_array[ArrayLen(image_array)].link_url =
    temp_link_url>
    <cfset image_array[ArrayLen(image_array)].file_type =
    left(ListLast(temp_link_url,"."),3)>
    </cfif>
    <cfset start_pos = temp_image_pos.pos[1] + 1>
    <cfelse>
    <cfbreak>
    </cfif>
    </cfloop>
    This is the type of code it has a hard time getting the image
    becuase it doesn't have a regular IMG tag.
    <div style="float: left; width: 82px; height: 59px;
    overflow: hidden; background: url(
    http://pix.crash.net/motorsport/80/388493.jpg);
    background-position: center center; background-repeat: no-repeat;
    margin: 1px;" onMouseOver="showTipGallery(Stoner, Australian MotoGP
    2007);" onMouseOut="clearTip();">
    Is there a way to modify this code to make it be able to look
    for the backround: url?? I am thinking that woul help it.. It knows
    that an image is there.. It just doesn't know what to do with
    it.

    How difficult is it for you to do a google image search for large images of this subject?
    While you appear to be doing this project for an educational endeavour and can get away with mild copyright abuse as "fair use", you probably should not expect the participants in this forum to 1) work for Disney either as a direct employee or as a contractor and 2) offer their copyrighted work for free.
    If you really want to impress a teacher and a future employer, you would use your own art. Why dont you create your own movie concept? Suppose you and your classmate are up for the same employment position. Who do you think will get hired if you show work that is not all your own, while your classmate has produced all of his/her own work?

  • Need help regarding image scanning from scanner and resizing it...

    Hi,
    I need help regarding scanning of image directly from scanner. Here is the scenario when the person clicks scan button on the webpage should scan the image and resize it and store it in some temp location. Is there any way i can do this. Any Help regarding this would be great!!!
    Thanks,
    Avinash.
    Edited by: Kalakonda on Jul 24, 2009 8:08 AM

    Kalakonda wrote:
    I need help regarding scanning of image directly from scanner. Here is the scenario when the person clicks scan button on the webpage should scan the image and resize it and store it in some temp location. Is there any way i can do this. Any Help regarding this would be great!!!So what you are doing is you have a Scanner (hardware: like an HP flatbed scanner) attached to a server that you want to use as a scanning station? Is this the senario that you are talking about?

  • Need Help With Image Gallery

    Hey all, I need a simple image gallery to load when you click a button.  I've tried shadowbox but have had absolutely zero luck. I'm not sure how to load it from a flash file and I know there is work that has to be done outside of flash like in the root folder. All I need is  for a simple image gallery, nothing fancy, to open when I hit a button. If anyone could explain how to use shadowbox in lamens terms or knows how to easily script a gallery that would be amazing.

    What script version is your target? AS2 or AS3

  • Hi, need help, displaying text in crystal report

    Post Author: decentsimple
    CA Forum: Crystal Reports
    CR8.5 help, displaying included or not included  i
    have a win app that calls the report, during rendering of report, the
    win app will first create a temp table that holds all the fields for
    the report, then the report is accessing that temptable. i want my report to display &#91;not&#93; included text for a field that contains the right value..here is the tricky part, the field is not in the temp table..is there a way for the crystal report to read the value of that certain field that is not in the temptable..so far.. i have a parameter     3 parameters, the value can be B/P/U          ?B / ?P /?U each parameter have its own formula:  @havefieldvalue        if {?B} = "T" then            ""  else  "Not" same for the rest..if the report generated have B     then the report should display B - includedsame for the rest.. 

    you can always use an array if there's no pattern to your positions:
    var positionA:Array=[ [100,20], [2,222], [55,2], [201,111], [78,23] ];
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import com.adobe.serialization.json.JSON;
    var loader:URLLoader = new URLLoader(new URLRequest("https://api.twitter.com/1/statuses/user_timeline.json?screen_name=ScottMitchell"));
    loader.addEventListener(Event.COMPLETE, loadComplete);
    function loadComplete(e:Event):void {
        processData(e.target.data);
    function processData(data:String):void {
        var tweets:Array = JSON.decode(data) as Array;
    for(var i:int=0;i<5;i++){
    var tf:TextField=new TextField();
    addChild(tf);
    tf.multiline=true;
    tf.width=300;
    tf.text =   tweets[i].text;
    tf.autoSize="left";
    tf.x=positionA[i][0];
    tf.y=positionA[i][1];
    nextY+=tf.height;

  • Need help displaying layouts

    I'm new to Java swing but have read the tutorials.. maybe I'm just not very fast learner. However I need to display some things, but having problems doing so in JavaSwing.
    Basically my display needs to be like this
    Name: <textfield>
    Address: <textfield>
    Are you married? <yes option> <no Option>
    My problem is the yes and no options. If I make the Grid 3 columns then the textfields are displayed in the 2nd column rather than spreading across the 2nd and 3rd columns. The other thing is I want all the Labels (name, address, are you married) to be on one left column while the other items are in another column. I guess this is kinda like a nest panel or something? I'm not really sure. Are there examples of how to do something like this? I learn best by examples.

    Swinging :) is kinda like a top-down * bottom-up approach (mix of both). So you gotta think from the top and implement from the bottom. (We can call this design-down, implement-up neh? :)
    1. Essentially, you need three rows, with two columns.
    2. First column contains three rows of the same size.
    3. Second column contains three rows too.
    a. First and second rows of second column span the entire row.
    c. Last row is split into two.
    Make a label panel for holding the labels such as "Name" and "Address". Make this a grid panel of 3 rows and 1 column. Call this LPANEL
    Now make another panel, this also with three rows and one column using a grid layout. Call this the FPANEL.
    Now, add a textfield to the first two rows.
    For the last, create a new panel with a grid layout with size 1x2 (1 row, 2 columns). Call this the OPANEL. Add it to the FPANEL last. So, now you have two panels. How do you ensure they line up?
    Set the same margin sizes (and insets) for all components/grid layouts.
    Finally, make a MPANEL (main panel) which uses grid bag layout. You want your FPANEL to expand to fill the MPANEL but the LPANEL should be constant no? So we use gridbaglayout and add LPANEL with normal constraints (read up on the constrainst and how to use gridbaglayout :). Add FPANEL with gridbagconstraints that cause it to fill the remainder of the space ("remainder" is the key here).
    Voila!
    Your are done :)
    Now, I would make your life easier by recommending you use netBeans for desiging UI's or Eclipse. But, a year of swinging by hand will give u enuf expertise that when u do start using netBeans etc, you will have be able to get the maximum out of them.
    tell me if u got it right!
    -vijai.

  • Need Urgent help--Display image as background of an email

    Dear All,
    Iam new to Java mail API.
    Someone please let me know if it is possible to make an image display as a background of an email using java mail.
    I had tried using below code.
    //code
    message.setContent( "<html><body><table width=\"100%\" height=\"90%\" border=\"0\" cellspacing=\"0\" cellpadding=\"20\" background=\"https://ttslemc.tatatel.co.in/EMC_FEEDBACK/imagepool/indicom_logo.jpg\"><tr><td>
    "+ content+ "
    </td></tr></table></body></html>",
    "text/html");
    //here content is a variable containing mail content captured from a html text area
    //code
    This is displaying me the image but the content formatting is lost.Everything appears in single line.
    Is it possible to have a background image and the content formatted properly for a html mail using java mail api.
    Please help me.....ASAP

    First, realize that how a message is displayed is up to the message reader being used.
    You can't control it, you can only provide suggestions.
    Using html text with a reference to an external image is a good start. I don't understand
    what you mean when you say "the content formatting is lost". Is none of the html formatting
    having any effect? Are you seeing the raw html instead of the formatted text?

  • Need help with image upload and preview display

    hi guys,
    I'm trying to upload image and then display it as a preview, but when upload form submits to the same page image placeholder does not refreshes it's source and displays the same image as before.
    Image 4.jpg already exists.
    I upload it with nameConflict = "overwrite"
    upload form points to the same page, therefore page reloads
    In IE image placeholder does not display the new image, but shows the old one until I refresh the page with F5 and resend information, however if checked, image in the file is already different.
    In Firefox, sometimes it works and image refreshes, sometimes not.
    any help would be greatly appreciated!
    cheers,
    Simon

    Hi Daverms,
    With your code you suggest to not only upload the image but make a database entry too. However my intention is to firstly upload the file, and show a preview. Then if user is satisfied with what he sees, he presses "aprove" button and therefore makes a datase entry. Then the photo number will increase by one.
    Until user is not aproving the photo he can upload any image again and again, but the new image will be always given the same name (example 4.jpg) and overwriting the old one.
    I believe the problem persists because browsers are loading image with the same name from the cache, and not from the actual location. Therefore when I refresh the page it catches the correct image.
    If I follow your code, every time I upload the image, name of it is different, therefore browser cannot find it in the cache and is forced to load one from the server.
    I wonder is there any way to avoid this cache problem?
    cheers,
    Simon

  • 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.

  • Displaying image on canvas as background for joystick display

    i am displating my joystick on canvas sucessfully and now i want to add a background image to it for better display please guide in detail. thanks in advance .. ahsan

    Hello ahsan, you can use CanvasDrawBitmap to draw ain image on the canvas.
    When searching for a function on a particular control, you can right-click on the control and choose "Control help" in the context menu: in case of the canvas you'll arrive to this help page where some useful resources are grouped. You can look at Programming with Canvas Controls to get some tip on how to use the control in you applications, of simply choose Canvas Control Functions to get a list of all function that can be used on that control. In this page CanvasDrawBitmap is listed.
    Additionally, if you go to Help >> Find examples... and search for canvas, you'll get a list of sample projects related to that control: "Alphablend" is one of them that shows how to draw an image on the canvas.
    By using these tips you'll be able to proceed in your work without necessarily wait for some forum user to help you.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Need help on image for my business.

    hi. I'm Mike Gambino, admin/founder of my own website called http://gambinoarmy.co.cc/. I've been using macromedia for this stuff but apparently, y'all have better stuff than macromedia and I started using the schools. I have a trial on my computer for 30 days and I have been using it and I need to know how to do something. I see that lots of business owners have images that are linked on their site and it is making me mad that everytime I want to make an image, fireworks will not let me do anything on it.
    there is something I want to do and it is to make an image that shows their signature, if they are online or not, when level their at, how long they have been playing, and so forth. I want to know if someone can help me give me a tutorial on how to make an image with HTML embeded into the image source so I can make it so that it is live and will work like most businesses do.
    since I hardly go on since I'm trying to edit my site still, I would like someone to email me at [email protected] so I can get it right on my computer and I will not have to hunt down this forum post. I'm mostly busy and I'm trying to keep my site running and up to date and it is a busy week for me since I'm trying to do a grand opening of my site since someone hacked my site and edited a lot of things and now I secured it and everything and recovered my lost data.
    please help me.

    gambino90 wrote:
    I wish I had the money too. I can't invest anymore on my site till lots of people come on my site and donate.
    I can't speak to your business model.
    is there even a way to take HTML scripts of PHP scripts, put it in a document and try using a <img src=" " /> code to try making it into an image?
    The wording of that question doesn't even make sense. HTML is not scripting, it isn't programming. It is markup for text display. The image tag is also not programming; it is the markup for HTML that displays an image that has been created and stored.
    For your desired functionality, something could probably be done with PHP and a database, if the person doing the work knew what he or she was doing. In any case, it isn't a Fireworks question. Fireworks creates graphics and it can output some HTML. It is not a programming environment.
    If you want to put the your desired functionality into your site yourself, you first need to learn what HTML is and is not, what it can and can't do. Then, you need to move on to learning a programming language (for example PHP, ColdFusion, Perl, C#/.NET), as well as SQL (the language) and some database expertise. You also will need to learn about securing your database-driven site.
    Good luck!

  • Need help Loading images with selection on a form field?

    So I'm kind of a newb.. I can do basic forms but I need to set up a form field drop down box that will give me the ability to load images correlating to the users choice. I'm at a total loss for where to start, so ANY help would be appreciated. If you know of any good books or tutorials on the subject please share.
    Thanks in advance
    Sincerely,
    Stumped4now 

    P.S. I think I'm getting a better understanding of OCGs after lots of research today. However I still seem to be missing something
    var docOCGs = this.getOCGs();
    for (var x=0; x < docOCGs.length; x++)
      if(docOCGs[x].name == "Layer1")
      docOCGs[x].state = !docOCGs[x].state;

Maybe you are looking for