dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: A little help with logic

Hybrid View

  1. #1
    Junior Member
    Join Date
    Dec 2005
    Posts
    1

    A little help with logic

    I am working a project that needs to do the following:
    I have a map of the US and I need to be able to click on a state and add it to a list. (Everyday I make a list of the coldest states for our shipping dept).

    Anyway I have done other things in Flash but I am having trouble on deciding the best way to do this project.

    Anyone have a tutorial that could be modified to do what I need or any ideas?

    Again, I need is a simple list (printable .txt or just show up on next to the map to print the screen) when states are selected.

  2. #2
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    You could use a movieclip for each state and upon selection, push the state into an array. Then it would just be a matter of printing the content in the array when finished. Say each movieclip has an instance name of the state it represents. You could then toggle a variable for each clip that allowed it to be added or removed from the array. Maybe something like....
    code:

    coldStates = [];
    kansas.onRelease = function() {
    if (!kansasSelected) {
    coldStates.push(this._name);
    trace(coldStates);
    kansasSelected = true;
    } else {
    coldStates.splice(this._name, 1);
    kansasSelected = false;
    trace(coldStates);
    }
    }
    missouri.onRelease = function() {
    if (!missouriSelected) {
    coldStates.push(this._name);
    trace(coldStates);
    missouriSelected = true;
    } else {
    coldStates.splice(this._name, 1);
    missouriSelected = false;
    trace(coldStates);
    }
    }



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