A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: space navigation

  1. #1
    JayVEE
    Join Date
    Jan 2001
    Location
    Kgn Jamaica
    Posts
    44

    space navigation

    Hi,

    I have a FLA that I found on levitated.

    http://www.levitated.net/daily/levTextSpace.html

    I want to use it for a nav system but I am not sure about how to make the words act as buttons or how to add actions to specific buttons.

    here is the code:


    // register root as environment
    Object.environment = this;
    // create camera object
    this.cam = {x:0, y:0, z:500, dx:0, dy:0, dz:-500};
    // set environmental constants
    this.fl = 1000;
    // create 'space' to which all words will be attached
    this.createEmptyMovieClip("space", 1);
    // center 'space' on the stage
    space._x = 300;
    space._y = 169;
    // a string of words related to the wind
    this.somewords = "wind breeze storm stormy tornado text space three dimensional infinite recursive instance object distort environmental atmospheric blow gush whoosh thrash whirl push roar rush caress flow swoop";
    // convert the string of words into an array of words
    this.wordList = new Array();
    this.wordList = this.somewords.split(" ");
    // create one instance for each word in the list
    for (n=0; n<this.wordList.length; n++) {
    // pick a word from the list
    var word = Object.environment.wordList[n];
    var x = random(600)-300;
    var y = random(337)-169;
    var z = random(Object.environment.fl*2)-Object.environment.fl;
    // create an instance of the SpaceWord object
    nombre = "word"+String(depth++);
    initialization = {txtword:word, x:x, y:y, z:z};
    space.attachMovie("spaceWord", nombre, depth, initialization);

    //The code I have added to utilise the words as links

    if (_root.spaceWord.txtword == "breeze") {
    with (_root.box) {
    gotoAndStop("test");
    }
    }
    }
    this.onEnterFrame = function() {
    this.cam.dz += .5;
    // move the camera to its destination
    this.cam.x += (this.cam.dx-this.cam.x)/10;
    this.cam.y += (this.cam.dy-this.cam.y)/10;
    this.cam.z += (this.cam.dz-this.cam.z)/30;
    };
    stop();


    Any help would be greatly appreciated.
    'til next time

  2. #2
    JayVEE
    Join Date
    Jan 2001
    Location
    Kgn Jamaica
    Posts
    44

    anybody?

    could please give me some advice?
    'til next time

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    i've added variables to the array "wind:a breeze:b..." and use "a", "b"...to navigate to frames of a loaded movie,

    hth

  4. #4
    JayVEE
    Join Date
    Jan 2001
    Location
    Kgn Jamaica
    Posts
    44

    Thank you

    It works perfectly! thank you very much I am in your debt!
    'til next time

  5. #5
    Junior Member
    Join Date
    Sep 2009
    Posts
    6
    This is an old thread but I might as well give it a try.

    Could someone please upload the working code or explain exactly how this works?
    I'm not sure how to add variables as described by a_modified_dog.

    Thanks!

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try opening a new thread with a specific question

    btw.. have you downloaded and studied the source files ?

  7. #7
    Junior Member
    Join Date
    Sep 2009
    Posts
    6
    Sorry about that. I thought it might be clearer (BTW: I sent you a PM with basiclly the same question. Please disregard it).

    I have the source files of the levitated text field. I understand it (to some level). I tried following the advice you gave (over 6 years ago), but cannot manage without some form of an example i'm affraid...

    At this point my code looks almost the same as the code in the first post. (exept for the words).

  8. #8
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    attached is a Flash 8 file
    navigation is via a movieclip on stage - myClip
    array of words is delimited by : ... wind:a .. etc

    letter "a" is a frame label of myClip
    Last edited by a_modified_dog; 09-22-2009 at 12:45 PM.

  9. #9
    Junior Member
    Join Date
    Sep 2009
    Posts
    6
    This is so cool of you to do this.
    Thanks a million man!
    It's a shame I don't know you because I owe you one.

    It's stuff like this that really helps me on my way in learning AS.

  10. #10
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    uploaded a_modified_fla
    Attached Files Attached Files

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