dcsimg
A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Two questions....

  1. #1
    Junior Member
    Join Date
    Jan 2004
    Location
    Michigan
    Posts
    20

    Two questions....

    I have had great luck getting help in the past on this site and was hoping you could all help me again. I have two questions that I cannot seem to find anything about online. So I will mine your brains for help!

    1. In my website I have a window that comes in on mouseover. On that window there are two buttons (larrow & rarrow). I want them to control another movie clip that holds thumbnails. The buttons would move that movie clip to the left and right. I know this would involve the _x property but cannot find how to make this work. When using the properties x and y display it looks like I need to increase the x by 55 to move it the correct amount. Meaning, a single click would move the movie clip by one thumbnail.
    I have also seen it where that button will ALSO move the image that is enlarged at the same time. Look to http://lonnatucker.com/ I am using that site as the inspiration for my navigation.

    2. When clicking on the thumbnail you want to see larger, I want it to load data on that specific image from an xml or text file into another information window called mov_info. When you would click on the above larrow and rarrow buttons, it would change that information as well.

    Any help or references to tutorials that could help me would be a HUGE help. I am really overwhelmed as this is my first project. It is coming along great thanks to your help, but still a lot to learn.

    Steve

  2. #2
    I hunt, therefore i am
    Join Date
    Aug 2006
    Location
    Wolverhampton, England
    Posts
    57

    Hmm

    I'm guessing your using a little flash (for the buttons and the mouseover) and the movie clip that's holding the thumbnails, try putting each thumbnail on a seperate frame within the movie clip, and on your button put something like

    On release {gotoAndPlay_root.THEMOVIECLIPWITHTHUMBNAILS.curre ntframe =+1

    If you need any extra help let me know( and if it doesn't work)

  3. #3
    Junior Member
    Join Date
    Jan 2004
    Location
    Michigan
    Posts
    20
    That would be a work around, but I am pretty sure there is another way to do it using actionscript. I have the movie clip masked and when you click on the button I want the movie clip location to move x amount on the x level.

    is this not possible?

  4. #4
    I hunt, therefore i am
    Join Date
    Aug 2006
    Location
    Wolverhampton, England
    Posts
    57

    Sorry

    I know a few people that could do it for you, but alas, i cannot help you with x and y coordinates, sorry

    i'll try to get some MODS in here ok!

  5. #5
    Senior Member
    Join Date
    Nov 2005
    Location
    Milan
    Posts
    119
    Moving the clip on the x axis is easy -

    Code:
    larrow.onRelease = function(){
       scrollMC(1);
    }
    
    rarrow.onRelease = function(){
       scrollMC(-1);
    }
    
    function scrollMC(direction){
        thumbnail_mc._x += 55*dir; //moves left or right depending on which arrow was pressed
    }
    As for the XML part, the help files are pretty good... if you're going to use XML I strongly recommend writing your code in SEPY actionscript editor http://www.sephiroth.it/python/sepy.php - it has an XML reader that's invaluable for helping you parse the file.

  6. #6
    Junior Member
    Join Date
    Jan 2004
    Location
    Michigan
    Posts
    20
    Thank you VERY much for your help.

    I will try both of your suggestions.

  7. #7
    Junior Member
    Join Date
    Jan 2004
    Location
    Michigan
    Posts
    20

    Am I Even Close?

    This is all in the first frame of the main movie.

    var leftdir = -1;
    var rightdir = 1;

    function scrollMC(direction){
    _root.mov_expand.mov_thumbs._x += 55; //moves left or right depending on which arrow was pressed
    }

    if (mov_expand.mov_larrow.hitTest(_root._xmouse, _root._ymouse, true)) {
    function scrollMC(leftdir);
    }

    else if (mov_expand.mov_rarrow.hitTest(_root._xmouse, _root._ymouse, true)) {
    function scrollMC(rightdir);
    }

  8. #8
    Junior Member
    Join Date
    Jan 2004
    Location
    Michigan
    Posts
    20
    I have also tried putting this code within the movie itself as a test.

    var thumbloc = mov_thumbs._x; // Thumbs Location
    trace(thumbloc);

    It is coming back undefined.

    How do you get the X value into the variable so I can increase or decrease it?

    I am getting flustered.

  9. #9
    Senior Member
    Join Date
    Nov 2005
    Location
    Milan
    Posts
    119
    First of all, I don't know why you're using hitTest - would it not be simpler to use RollOver and stop the action on RollOut? Secondly, in the scrollMC function you've left out the *dir part - without that it will always move inthe same direction.

    _root.mov_expand.mov_thumbs._x += 55*dir;

    Plus, you don't need _root.

    Your trace action isn't working cos you're tracing mov_thumbs._x, when you should be tracing mov_expand.mov_thumbs._x

  10. #10
    Junior Member
    Join Date
    Jan 2004
    Location
    Michigan
    Posts
    20
    I was using hittest because it is a movie within a movie, and wasn't recognizing clicks on it because so.

  11. #11
    Junior Member
    Join Date
    Jan 2004
    Location
    Michigan
    Posts
    20
    That code did not work either.

    Anyone have any advice?

    Maybe I should just do a go to and play to tween it. Seems like this way is way too complicated.

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