facebook

iPhone app – copy image from one panel to another

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #336851 Reply

    Hi there,

    In Mobione design mode creating an app for the iPhone. How do I make my app copy an image from one panel to another panel on a separate .mobi file by just pressing or touching on that image?

    Any help on this would be appreciated.

    Thanks,

    Robert
    (619) 733-1228

    #336892 Reply

    Hi Robert,

    Do you want to copy the images on Design Center of one .mobi file to another one? Or do you want to do some codding that make image in current screen will be copied to secondary screen? For first thing you just need select your image in first screen use the short-cut CTRL + C and then go to secondary screen and paste your image with short-cut CTRL + V

    #336895 Reply

    Hi there,

    Thanks for getting back to me.

    You missed my question.

    I want the end-user (Not me) to be able to touch an image on their iPhone…and that same image will be copied into another panel in a different screen. So in essence that image is copied and transferred into a separate screen that the end-user will be able to view on their iPhone.

    How do I go about designing this in Mobione?

    Thanks,
    Robert

    #336908 Reply

    Brandon
    Member

    I think this is what you want.

    On the first image set the action to run javascript and try this.

    
    $('#m1-screen1-image1').attr('src', $('#m1-screen2-image1').attr('src'));
    

    That will copy the image1 on screen1 to image1 on screen2 then they touch it.

    #336918 Reply

    I have 2 .mobi files in my app. I named them test1.mobi and test2.mobi.

    Each screen has a panel (panel1).

    So would the code below work? Please check for syntax. Thanks.

    $(‘#m1-panel1-image1’).attr(‘test1.mobi’, $(‘#m1-panel1-image1’).attr(‘test2.mobi’));

    #336920 Reply

    Brandon
    Member

    You would just need to adjust the screen name:

    $('#m1-test1-image1').attr('src', $('#m1-test2-image1').attr('src'));
    #336921 Reply

    I pasted the below code in the code box and it doesnt work. I am testing this in the test center by emulating the finger using my mouse but when I click on the image it doesn’t do anything.

    So what I’m doing is I click on the image…thenafter I click on the button that will take me to the second screen. But I don’t see the image there

    $(‘#m1-test1-image1’).attr(‘src’, $(‘#m1-test2-image1’).attr(‘src’));

    #336922 Reply

    Brandon
    Member

    Sorry, looking at it my code is backwards.

    $('#m1-test2-image1').attr('src', $('#m1-test1-image1').attr('src'));
    #336923 Reply

    It’s still not working….

    basically I want to click on the image from screen one. When I do that I want screen two to display on the iPhone with the image from screen one. So in essence it will take me to screen two with a copy of that image.

    Your help is appreciated.

    #336924 Reply

    Hello…did I lose you?

    #336925 Reply

    are you there?

    #336926 Reply

    Brandon
    Member

    Yeah, I dont think I quite understand. That takes the image from the test1 screen and copies it into the test2 screen…did you want it to automatically go to the test2 screen also? if so just add:

    phoneui.gotoPage('m1-test2')
    #336927 Reply

    phoneui.gotoPage(‘m1-test2’) works good. thanks.

    but the code below appears to not execute:

    $(‘#m1-test2-image1’).attr(‘src’, $(‘#m1-test1-image1’).attr(‘src’));

    Is there anything wrong with the syntax? Can you please test on your PC? I’m using .GIF file as an image.

    #336929 Reply

    ok this is getting wierder ….

    in regards to phoneui.gotoPage(‘m1-test2’), this only works with the images when I place a button on the screen and “OnClick” I set “Go to Screen” to test2.mobi.

    If i get rid of this button, phoneui.gotoPage(‘m1-test2’) does not work with the images… in other words it will not go to test2

    Is this a bug? Can you test in your PC?

    #336930 Reply

    Brandon
    Member

    Here is a test project that works well. If you click on the button it will take you to the test2 screen with the facebook image. If you click the image it copies the image to test2, so they will both be the m1 logo, and automatically goes there.

    Attachments:
    You must be logged in to view attached files.
Viewing 15 posts - 1 through 15 (of 16 total)
Reply To: iPhone app – copy image from one panel to another

You must be logged in to post in the forum log in