A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: help me customize a scrolling image tutorial pls

Threaded View

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    13

    help me customize a scrolling image tutorial pls

    hi, i'm hoping you guys can help me figure out how to customize this flash scrolling book movie i have. I found a great tutorial online and followed it and loved it. http://www.republicofcode.com/tutori.../imagegallery/

    my scrolling book movie - http://bit.ly/cmbafB

    in that tutorial you will notice he has the user clicking on the images and seeing the image larger. I would like each image when clicked to go to a specified url.

    I don't know crap about code and want to finish my project. i would like to understand what is going on so I can figure it out next time myself.
    His comments are VERY helpful, but i am still confused a bit.

    Code:
    for (i=1; i<=imagesNumber; i++) {
    container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);
    when this code runs i is equal to 1.
    imagesNumber is 17, so we know i is less than imagesNumber. i++ increments i, so is i now = to two? so is the container that will be created named: thumb2_mc?
    what does the i (i bolded it)mean on the end of the code?

    to add my urls, how do i tell this thing to attach my urls to each thumb_mc?
    I did a trace on myThumb_mc and it's 17 everytime. why is that? Where in the code is it assigning each image a name and can I assign a url to it too?
    sorry to be a pain. i got a lot of questions and i'm confused as heck.



    Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    //Creating the Container
    this.createEmptyMovieClip("container",1);
    
    
    var imagesNumber:Number = 17;
    for (i=1; i<=imagesNumber; i++) {
    container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);
    
    //Attaching the Images and Aligning Them on Stage
    
    myThumb_mc = container["thumb"+i+"_mc"];
    myThumb_mc._x = (i-1)*myThumb_mc._width;
    myThumb_mc._y = (Stage.height-myThumb_mc._height)/2
    }
    
    //Creating the Scrolling Effect - to speed up or slow down change (*5) container.onEnterFrame = function (){
    this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*5;
    if (this._x>0) {
    this._x = 0;
    }
    if (-this._x>(this._width-Stage.width)) {
    this._x = -(this._width-Stage.width);
    }
    };
    
    //Assigning a Variable to Each Thumb
    
    for (i=1; i<=imagesNumber; i++) {
    container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);
    myThumb_mc = container["thumb"+i+"_mc"];
    myThumb_mc._x = (i-1)*myThumb_mc._width;
    myThumb_mc._y = (Stage.height-myThumb_mc._height)/2
    myThumb_mc.largerImage = i;
    }
    
    
    
    //making the buttons clickable
    
    myThumb_mc.onRelease = function(){
    			
    _root.attachMovie("image"+this.largerImage,"large_mc",2);
    trace(myThumb_mc);
    }
    }
    can't i simply add a if(myThumb_mc is = to 3 url ="http....) instead of _root.attach...
    myThumb_mc.onRelease = function(){

    _root.attachMovie("image"+this.largerImage,"large_ mc",2);
    trace(myThumb_mc);
    Last edited by christylove; 11-08-2010 at 04:44 PM.

Tags for this Thread

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