A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help Understanding this actionscript...

  1. #1
    Join Date
    Apr 2004

    Help Understanding this actionscript...

    I found the attached .fla on a website, and I was trying to figure out how it all works... and I figured out a good portion of it, but I was wondering what line of script in frame 1 of the movie tells it line up the circles horizontally...

    I am trying to create something of a similar effect, however I want them to line up vertically... How would the actionscript change to make the circle vertical?

    If you have the time to look at this I would greatly appreciate it


    - Mikey
    Attached Files Attached Files

  2. #2
    President PhobiK's Avatar
    Join Date
    Jan 2005
    Done!, here it is:

    align = bottom;
    centerx = Stage.width/2;
    centery = Stage.height/2;
    menuholder = createEmptyMovieClip("menuholder", -1);
    menuholder._x = centerx;
    menucount = 10;
    menuitems = [];
    miwidth = 20;
    miborder = 1;
    starty = centery-((menucount-1)*(miwidth+miborder))/2;
    for (var i = 0; i<menucount; i++) {
    var menuitem = menuholder.attachMovie("menuitem", "menu"+i, i);
    menuitem._y = starty+i*(miwidth+miborder);
    menuitem.id = i;
    menuitem.onRollOver = function() {
    _root.selected = this;
    onEnterFrame = function () { var width = 0;for (var i = 0; i<menucount; i++) {var xxm = menuitems[i]._xmouse;var yym = menuitems[i]._ymouse;var xm = Math.sqrt(xxm*xxm+yym*yym);if (xm<50) {menuitems[i]._xscale = menuitems[i]._yscale += ((200-xm)-menuitems[i]._yscale)/3;} else {menuitems[i]._xscale = menuitems[i]._yscale += (100-menuitems[i]._yscale)/3;}width += menuitems[i]._width;}width += (menucount-1)*miborder;var xpos = Math.round(centerx-width/2);for (var i = 0; i<menucount; i++) {xpos += menuitems[i-1]._width/2+miborder+menuitems[i]._width/2;menuitems[i]._y = xpos;}};
    This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.

    This is my Blog!... The gaming Process
    Please check out my site: Giddel Creations

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