A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: [RESOLVED] Exact position

  1. #1
    Member
    Join Date
    Apr 2003
    Location
    Always from The Bronx
    Posts
    36

    [RESOLVED] Exact position

    This one is so basic I'm embarrased to even ask, but I just can't find it in the Bibles. Using action script I want my movie to load a .jpg to a certain positon x=40 and y=50. I also want that .jpg to be in a specific layer so it will fall behind another graphic on the layer above it.

    I can get the .jpg loaded using loadMovieNum but the posotion and layer are driving me crazy. I looked in the tutorials and searched the Boards and I'm stuck. I don't think I really know how to ask the question in the searches I've done. Any ideas where to look.

    As always, thanks,

    Ivan
    Lynx Airways Worldwide
    "Leading the way, while others merely follow."

    CEO Lynx Airways Worldwide

    Chief Executive Officer
    Special Operations Officer

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    well first is.. HOW are you loading your images? I recommend using containerClips (targets)...empty movieClips to load your images into.

    example: (you already have a blank/empty movieClip on the stage w/ instnce name of containerClip')

    //load image
    containerClip.loadMovie("image1.jpg");
    //move image
    containerClip._x = 100;
    containerClip._y = 100;

    now wherever this cintaienrClip is..is where the imagewill display..so if you have another layer above it.. the image will be below it.

  3. #3
    Member
    Join Date
    Apr 2003
    Location
    Always from The Bronx
    Posts
    36
    I tried it but nothing happened. I'm using Flash MX, sorry for not mentioning that before.
    Lynx Airways Worldwide
    "Leading the way, while others merely follow."

    CEO Lynx Airways Worldwide

    Chief Executive Officer
    Special Operations Officer

  4. #4
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    I think that in Flash MX the syntax is just slightly different. You will still want to create a holder movie clip named container and then use this actionscript:
    Code:
    //load image
    loadMovie("image1.jpg", containerClip);
    //move image
    containerClip._x = 100;
    containerClip._y = 100;
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  5. #5
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Im almost certain this:
    Code:
    containerClip.loadMovie("image1.jpg");
    is valid in MX.....even in F5 I believe.

    hey JP..you know anyhing about PHP? any good? specifically when it comes to readdir() method?..and directories vs. files..etc?

  6. #6
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    Correct me if i'm wrong but I don't think that the dot syntax came into play until AS2.0. I know that in Flash 5 and possibly 6 the ._x didn't work. We had to use tellTarget.
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  7. #7
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    I thought Flash 5 is when the dot syntax was introduced? Im fairly certain it is..

    while tellTarget could still be used.. the dot syntax was there.

    (and is it that you dont know php, or do we have to settle this before you can help me) :P (maybe you didnt see bottom of last post about php help)

  8. #8
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    Sorry I didn't see the PHP question. I am fairly good with PHP4. Haven't dived into 5 a whole lot yet.

    I just pulled out my Flash MX Actionscripting Advanced Training From The Source book and it says that you have to use:
    Code:
    //load image
    loadMovie("image1.jpg", "containerClip");
    //move image
    containerClip._x = 100;
    containerClip._y = 100;
    That differs from the help file in that it puts quotes around the target clip name. I noticed that they use the dot syntax in a lot of examples throughout the book however it's never used with loadMovie. I wonder if maybe it didn't become available for loadMovie until MX2004. I haven't done a whole lot with loading movie clips though so don't quote me on that.
    Last edited by jasonsplace; 01-23-2007 at 04:29 PM.
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  9. #9
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Ive never really used it that way you have posted..always the way I have..even in Flash 5. (since I was stubborn about making the move to MX until I saw how crappy 2004 was to me)

    I still have MX installed at home.. I will for sure test it tonight.. but I even think Flash 5 let me do this. (swear) LOL

    anyways.. I posted something in the scripting/backend forum about using the readdir() in PHP a little better or more to its 'capabilities' for my needs than I have been

    been bugging me... and Im dying to get some help.. MusicMan posted.. but Im still lost..LOL

  10. #10
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    I posted some help for you in your other thread. Hopefully that solves your problem. I really wish that I had old versions of Flash installed still for questions like this. I have Flash 5 and MX CD sitting at home. Maybe i'll have to try too. I can always remember what's deprecated and what isn't just not exactly when it was deprecated.
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  11. #11
    Member
    Join Date
    Apr 2003
    Location
    Always from The Bronx
    Posts
    36
    I just came home and tried this on my Flash 8 and it still did not work. I took a regular .jpg file and used the loadMovieNum to have Flash load the movie to a layer. That worked fine. Then I added the containerClip._x = 100; and containerClip._y = 100;. when I ran the movie after saving it, the graphic still went to the upper left hand corner. I tried changing the numbers but no joy.
    Lynx Airways Worldwide
    "Leading the way, while others merely follow."

    CEO Lynx Airways Worldwide

    Chief Executive Officer
    Special Operations Officer

  12. #12
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    ok..well your talking about two different things here..

    either you want to load the image into a blank/empty movieClip on the stage with the instance name of 'containerClip', using loadMovie();

    or you want to load your image into a _level, using loadMovieNum(); which is different..and takes another parameter.

  13. #13
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    I've just tried it using both methods and even published it as a Flash 5 file using both methods and it worked. I have attached an Fla example saved as an MX2004 file.
    Attached Files Attached Files
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

  14. #14
    Member
    Join Date
    Apr 2003
    Location
    Always from The Bronx
    Posts
    36
    Jason,

    That's it!!!!!!!! Thanks for the file that helped me see what I was doing wrong. Like whispers said above, I was trying to do two things at the same time and had it all mixed up. You saved the day.

    Thanks to all of you for a very interesting thread. You guys really know your stuff and always come to the rescue. Thanks.

    Ivan
    Lynx Airways Worldwide
    "Leading the way, while others merely follow."

    CEO Lynx Airways Worldwide

    Chief Executive Officer
    Special Operations Officer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center