How can I do this?

  • catil
  • Born
  • Born
  • catil
  • Posts: 4

Post 3+ Months Ago

What I basically want to do is a webpage with a map on it, consisiting of several layers, which you can all fade in and out or just show only what you like to see with checkboxes or something.
Every User should then be able to add (still dragable) "points" to a specific layer and comment on them (below the map) and other users should then be able to add their comment to the generated point, too.

I don't really know if Flash is the way to go here, but it's the only thing I know a little bit of, besides plain HTML. You can suggest other ways, too.
Best would be without programming at all, if possible. :)

Thanks in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

You can do this several ways. I think Flash is a good way.

You're not going to avoid programming here. You're also going to need some client/server interaction if you want the user input to persist between sessions.

Good luck.
  • catil
  • Born
  • Born
  • catil
  • Posts: 4

Post 3+ Months Ago

Thanks, but could you please get a little bit more in detail on this?
Would I need Flash MX or does it a free(?) application like Swish, or something completly different?

And I guess it's possible to do the map thingy in an upper Flash frame and the comment system just as a simple kind of guestbook below, is ít?

Any more help, e.g. code examples or deeper explaination, would be very nice, too.
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

I'm not really familiar with Swish, and I've been using Flash MX 2k4 for a good while now.

Ok, so I've actually built an application recently that deals with maps. It's an application (not a web app) that lets a teacher build a map with hotspots and questions. The app spits out a SWF, an XML file, and copies all the maps used to a package that the teacher uploads to a web server. So, it's similar in some respects but not the same.

For the maps, I have 5 layers. They are landforms, political borders, longitude/latitude, labels and capitals. I use checkboxes so the teacher can turn them on or off.

The hotspots are placed by the teacher and are numbered sequentially as the teacher drags and drops them onto the map. The can also mark one hotspot per question as correct.

From reading your post, I'm inclined to think in 3 layers...

Flash > ASP/PHP > Database

As for dividing the page up, I say if you're already working in Flash, why add the layers of a frame and a guestbook/talkbox.

If you're looking for specific code on how to do this, I think that's waaaaaay toooo open ended. If I sat down to do this, it would take me several days to conceive a structure and write the majority of the code components which would then likely be re-written as I got into it and discovered where my concepts were going right and wrong.
  • catil
  • Born
  • Born
  • catil
  • Posts: 4

Post 3+ Months Ago

Mmh... well, I just wanted to make sure that there is no easy way to do this, so I think I will have to outsource this whole task.

But is there a link to your application? I am highly interested, as my web app should in fact turn out to something very similiar and has something to do with e-learning as well.

If you don't have it handy and to upload first, don't do it. You already really helped me a lot and I couldn't do this on my own anyway.

Thank you very much.
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

hmmm, I don't have it online. I'll see what I can do.
I suppose I could post my actionscript.

I'll see if I can dig it up later, when I'm not at work
:D
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

Here goes nothing. :) Hope you find something helpful in here.

My creation tool is called "Cartographer" and the viewer is called "Geographer".

Cartographer - Frame 1, Initialize
Code: [ Select ]
fscommand("Folder.GetFilesList", "myResult=[SrcDir]\\maps,*.swf");
//
///////////Dialog Management
testTitleButton.onRelease = function() {
    if (testTitle.length>0) {
        allDialogsOff();
        questionTextOn();
    }
};
questionTextButton.onRelease = function() {
    if (questionText.length>0) {
        allDialogsOff();
        feedbackCorrectOn();
    }
};
feedbackCorrectButton.onRelease = function() {
    if (feedbackCorrect.length>0) {
        allDialogsOff();
        feedbackIncorrectOn();
    }
};
feedbackIncorrectButton.onRelease = function() {
    if (feedbackIncorrect.length>0) {
        allDialogsOff();
        enablePanel();
    }
};
function allDialogsOff() {
    testTitleField._visible = false;
    testTitleBkgnd._visible = false;
    testTitleButton._visible = false;
    questionTextField._visible = false;
    questionTextBkgnd._visible = false;
    questionTextButton._visible = false;
    feedbackIncorrectField._visible = false;
    feedbackIncorrectBkgnd._visible = false;
    feedbackIncorrectButton._visible = false;
    feedbackCorrectField._visible = false;
    feedbackCorrectBkgnd._visible = false;
    feedbackCorrectButton._visible = false;
}
function testTitleOn() {
    testTitleField._visible = true;
    testTitleBkgnd._visible = true;
    testTitleButton._visible = true;
}
function questionTextOn() {
    questionTextField._visible = true;
    questionTextBkgnd._visible = true;
    questionTextButton._visible = true;
}
function feedbackIncorrectOn() {
    feedbackIncorrectField._visible = true;
    feedbackIncorrectBkgnd._visible = true;
    feedbackIncorrectButton._visible = true;
}
function feedbackCorrectOn() {
    feedbackCorrectField._visible = true;
    feedbackCorrectBkgnd._visible = true;
    feedbackCorrectButton._visible = true;
}
function disablePanel() {
    mapMenu.enabled = true;
    correctCheckBox.enabled = false;
    clearLastHotspots.enabled = false;
    addQuestion.enabled = false;
    exportButton.enabled = false;
}
function enablePanel() {
    mapMenu.enabled = true;
    correctCheckBox.enabled = true;
    clearLastHotspots.enabled = true;
    addQuestion.enabled = true;
    exportButton.enabled = true;
}
allDialogsOff();
testTitleOn();
disablePanel();
  1. fscommand("Folder.GetFilesList", "myResult=[SrcDir]\\maps,*.swf");
  2. //
  3. ///////////Dialog Management
  4. testTitleButton.onRelease = function() {
  5.     if (testTitle.length>0) {
  6.         allDialogsOff();
  7.         questionTextOn();
  8.     }
  9. };
  10. questionTextButton.onRelease = function() {
  11.     if (questionText.length>0) {
  12.         allDialogsOff();
  13.         feedbackCorrectOn();
  14.     }
  15. };
  16. feedbackCorrectButton.onRelease = function() {
  17.     if (feedbackCorrect.length>0) {
  18.         allDialogsOff();
  19.         feedbackIncorrectOn();
  20.     }
  21. };
  22. feedbackIncorrectButton.onRelease = function() {
  23.     if (feedbackIncorrect.length>0) {
  24.         allDialogsOff();
  25.         enablePanel();
  26.     }
  27. };
  28. function allDialogsOff() {
  29.     testTitleField._visible = false;
  30.     testTitleBkgnd._visible = false;
  31.     testTitleButton._visible = false;
  32.     questionTextField._visible = false;
  33.     questionTextBkgnd._visible = false;
  34.     questionTextButton._visible = false;
  35.     feedbackIncorrectField._visible = false;
  36.     feedbackIncorrectBkgnd._visible = false;
  37.     feedbackIncorrectButton._visible = false;
  38.     feedbackCorrectField._visible = false;
  39.     feedbackCorrectBkgnd._visible = false;
  40.     feedbackCorrectButton._visible = false;
  41. }
  42. function testTitleOn() {
  43.     testTitleField._visible = true;
  44.     testTitleBkgnd._visible = true;
  45.     testTitleButton._visible = true;
  46. }
  47. function questionTextOn() {
  48.     questionTextField._visible = true;
  49.     questionTextBkgnd._visible = true;
  50.     questionTextButton._visible = true;
  51. }
  52. function feedbackIncorrectOn() {
  53.     feedbackIncorrectField._visible = true;
  54.     feedbackIncorrectBkgnd._visible = true;
  55.     feedbackIncorrectButton._visible = true;
  56. }
  57. function feedbackCorrectOn() {
  58.     feedbackCorrectField._visible = true;
  59.     feedbackCorrectBkgnd._visible = true;
  60.     feedbackCorrectButton._visible = true;
  61. }
  62. function disablePanel() {
  63.     mapMenu.enabled = true;
  64.     correctCheckBox.enabled = false;
  65.     clearLastHotspots.enabled = false;
  66.     addQuestion.enabled = false;
  67.     exportButton.enabled = false;
  68. }
  69. function enablePanel() {
  70.     mapMenu.enabled = true;
  71.     correctCheckBox.enabled = true;
  72.     clearLastHotspots.enabled = true;
  73.     addQuestion.enabled = true;
  74.     exportButton.enabled = true;
  75. }
  76. allDialogsOff();
  77. testTitleOn();
  78. disablePanel();


Cartographer - Frame 2, Main code
Code: [ Select ]
stop();
//
///////////load externals, set some properties and variables
currentQuestion = 1;
currentHotspotNumber = 1;
ds1.addItem();
ds1.id = currentQuestion;
testNavigation.swapDepths(100);
frame.swapDepths(101);
//
///////////Map Management
myResult = myResult.split(".swf\r\n");
mapCount = myResult.length;
for (i=1; i<mapCount; i++) {
    menuItem = myResult.shift();
    mapMenu.addItem(menuItem);
}
mapMenu.change = function(eventObj) {
    if (eventObj.target.value !== "Select a map") {
        mapToGet = eventObj.target.value;
        workArea.loadMovie("maps/"+mapToGet+".swf");
        ds1.mapname = mapToGet;
        mapChooseInstruct._visible = false;
    }
};
mapMenu.addEventListener("change", mapMenu);
mapMenu.enabled = false;
//
///////////question management
addQuestion.onPress = function() {
    ds1.text = questionText;
    questionText = "";
    ds1.feedbackTrue = feedbackCorrect;
    feedbackCorrect = "";
    ds1.feedbackFalse = feedbackIncorrect;
    feedbackIncorrect = "";
    questionTextOn();
    disablePanel();
    for (i=1; i<=currentHotspotNumber; i++) {
        eval("hotspot"+i).removeMovieClip();
    }
    currentHotspotNumber = 1;
    currentQuestion += 1;
    ds1.addItem();
    ds1.id = currentQuestion;
    workArea.unloadMovie();
    mapChooseInstruct._visible = true;
};
//
///////////hotspot management
checkCorrect = new Object();
checkCorrect.click = function(eventObj) {
    if (eventObj.target.selected === true) {
        spotIsCorrect = true;
    } else {
        spotIsCorrect = false;
    }
};
correctCheckBox.addEventListener("click", checkCorrect);
hotspot.onPress = function() {
    newHotspot = "hotspot"+currentHotspotNumber;
    this.duplicateMovieClip(newHotspot, currentHotspotNumber);
    this[newHotspot+".myLabel"] = currentHotspotNumber;
    startDrag(newHotspot);
};
hotspot.onReleaseOutside = function() {
    newHotspot = "hotspot"+currentHotspotNumber;
    ds2.addItem();
    ds2.id = currentHotspotNumber;
    ds2.qid = currentQuestion;
    ds2.locx = eval(newHotspot)._x;
    ds2.locy = eval(newHotspot)._y;
    if (spotIsCorrect === true) {
        ds2.correct = "true";
        eval(newHotspot).gotoAndStop(2);
    } else {
        ds2.correct = "false";
    }
// reset isCorrect checkbox
    correctCheckBox.selected = false;
    spotIsCorrect = false;
    stopDrag();
    eval(newHotspot).onPress = function() {
        ds2.first;
        spottarget = int(this.Label.text);
        ds2.filtered = true;
        ds2.filterFunc = function(item:Object) {
            return (item.qid === currentQuestion);
        };
        ds2.first();
        for (i=0; i<99; i++) {
            if (ds2.id != spottarget) {
                ds2.next();
            } else {
                i = 100;
            }
        }
        this.startDrag();
    };
    eval(newHotspot).onRelease = function() {
        this.stopDrag();
        ds2.locx = this._x;
        ds2.locy = this._y;
        ds2.filtered = false;
        ds2.last();
    };
    currentHotspotNumber += 1;
};
clearLastHotspots.onPress = function() {
    if (ds2.qid === currentQuestion) {
        ds2.removeItem();
        eval("hotspot"+(currentHotspotNumber-1)).removeMovieClip();
        currentHotspotNumber -= 1;
    }
};
//
///////////Export XML
exportButton.onPress = function() {
    ds1.text = questionText;
    ds1.feedbackTrue = feedbackCorrect;
    ds1.feedbackFalse = feedbackIncorrect;
    ds1.first();
    for (i=1; i<=currentQuestion; i++) {
        fscommand("File.Copy", "Result=[SrcDir]maps\\"
add ds1.mapname add ".swf," add [SrcDir] add testTitle add "\\maps\\"
add ds1.mapname add ".swf");
        ds1.next();
    }
    ds1.first();
    ds2.first();
    for (i=1; i<=currentQuestion; i++) {
        do {
            tempHotspotString = "<hotspot><id>"+ds2.id+"</id><locx>"+ds2.locx+"</locx><locy>"+ds
2.locy+"</locy><isCorrect>"+ds2.correct+"</isCorrect></hotspot>";
            hotspotString = hotspotString+tempHotspotString;
            tempHotspotString = "";
            ds2.next();
        } while (ds2.qid === ds1.id && ds2.hasNext());
        tempBuildXML = "<question><id>"+ds1.id+"</id><text>"+ds1.text+"</text><mapnam
e>"+ds1.mapname+"</mapname><feedbackTrue>"+ds1.feedbackTrue+
"</feedbackTrue><feedbackFalse>"+ds1.feedbackFalse+"</feedbackFalse>"+hotspotString+"</question>";
        buildXML = buildXML+tempBuildXML;
        hotspotString = "";
        ds1.next();
    }
    myXMLOutput = buildXML;
    myXML = "<?xml version='1.0' encoding='UTF-8' ?
><geo><name>"+testTitle+"</name>"+myXMLOutput+"</geo>";
    fscommand("File.Write", [SrcDir] add testTitle
add "\\xml\\geo.xml," add myXML);
    fscommand("File.Copy", "Result=[SrcDir]geographer.swf,[SrcDir]" add testTitle add "\\geographer.swf");
    fscommand("File.Copy", "Result=[SrcDir]index.html,[SrcDir]"
add testTitle add "\\index.html");
    fscommand("File.Copy", "Result=[SrcDir]geo.html,[SrcDir]" add
testTitle add "\\geo.html");
    fscommand("File.Copy", "Result=[SrcDir]geo_alternate.html,
[SrcDir]" add testTitle add "\\geo_alternate.html");
    fscommand("File.Copy", "Result=[SrcDir]alternate.gif,[SrcDir]"
add testTitle add "\\alternate.gif");
    fscommand("File.Copy", "Result=[SrcDir]flash_detection.swf,
[SrcDir]" add testTitle add "\\flash_detection.swf");
    fscommand("quit");

};
  1. stop();
  2. //
  3. ///////////load externals, set some properties and variables
  4. currentQuestion = 1;
  5. currentHotspotNumber = 1;
  6. ds1.addItem();
  7. ds1.id = currentQuestion;
  8. testNavigation.swapDepths(100);
  9. frame.swapDepths(101);
  10. //
  11. ///////////Map Management
  12. myResult = myResult.split(".swf\r\n");
  13. mapCount = myResult.length;
  14. for (i=1; i<mapCount; i++) {
  15.     menuItem = myResult.shift();
  16.     mapMenu.addItem(menuItem);
  17. }
  18. mapMenu.change = function(eventObj) {
  19.     if (eventObj.target.value !== "Select a map") {
  20.         mapToGet = eventObj.target.value;
  21.         workArea.loadMovie("maps/"+mapToGet+".swf");
  22.         ds1.mapname = mapToGet;
  23.         mapChooseInstruct._visible = false;
  24.     }
  25. };
  26. mapMenu.addEventListener("change", mapMenu);
  27. mapMenu.enabled = false;
  28. //
  29. ///////////question management
  30. addQuestion.onPress = function() {
  31.     ds1.text = questionText;
  32.     questionText = "";
  33.     ds1.feedbackTrue = feedbackCorrect;
  34.     feedbackCorrect = "";
  35.     ds1.feedbackFalse = feedbackIncorrect;
  36.     feedbackIncorrect = "";
  37.     questionTextOn();
  38.     disablePanel();
  39.     for (i=1; i<=currentHotspotNumber; i++) {
  40.         eval("hotspot"+i).removeMovieClip();
  41.     }
  42.     currentHotspotNumber = 1;
  43.     currentQuestion += 1;
  44.     ds1.addItem();
  45.     ds1.id = currentQuestion;
  46.     workArea.unloadMovie();
  47.     mapChooseInstruct._visible = true;
  48. };
  49. //
  50. ///////////hotspot management
  51. checkCorrect = new Object();
  52. checkCorrect.click = function(eventObj) {
  53.     if (eventObj.target.selected === true) {
  54.         spotIsCorrect = true;
  55.     } else {
  56.         spotIsCorrect = false;
  57.     }
  58. };
  59. correctCheckBox.addEventListener("click", checkCorrect);
  60. hotspot.onPress = function() {
  61.     newHotspot = "hotspot"+currentHotspotNumber;
  62.     this.duplicateMovieClip(newHotspot, currentHotspotNumber);
  63.     this[newHotspot+".myLabel"] = currentHotspotNumber;
  64.     startDrag(newHotspot);
  65. };
  66. hotspot.onReleaseOutside = function() {
  67.     newHotspot = "hotspot"+currentHotspotNumber;
  68.     ds2.addItem();
  69.     ds2.id = currentHotspotNumber;
  70.     ds2.qid = currentQuestion;
  71.     ds2.locx = eval(newHotspot)._x;
  72.     ds2.locy = eval(newHotspot)._y;
  73.     if (spotIsCorrect === true) {
  74.         ds2.correct = "true";
  75.         eval(newHotspot).gotoAndStop(2);
  76.     } else {
  77.         ds2.correct = "false";
  78.     }
  79. // reset isCorrect checkbox
  80.     correctCheckBox.selected = false;
  81.     spotIsCorrect = false;
  82.     stopDrag();
  83.     eval(newHotspot).onPress = function() {
  84.         ds2.first;
  85.         spottarget = int(this.Label.text);
  86.         ds2.filtered = true;
  87.         ds2.filterFunc = function(item:Object) {
  88.             return (item.qid === currentQuestion);
  89.         };
  90.         ds2.first();
  91.         for (i=0; i<99; i++) {
  92.             if (ds2.id != spottarget) {
  93.                 ds2.next();
  94.             } else {
  95.                 i = 100;
  96.             }
  97.         }
  98.         this.startDrag();
  99.     };
  100.     eval(newHotspot).onRelease = function() {
  101.         this.stopDrag();
  102.         ds2.locx = this._x;
  103.         ds2.locy = this._y;
  104.         ds2.filtered = false;
  105.         ds2.last();
  106.     };
  107.     currentHotspotNumber += 1;
  108. };
  109. clearLastHotspots.onPress = function() {
  110.     if (ds2.qid === currentQuestion) {
  111.         ds2.removeItem();
  112.         eval("hotspot"+(currentHotspotNumber-1)).removeMovieClip();
  113.         currentHotspotNumber -= 1;
  114.     }
  115. };
  116. //
  117. ///////////Export XML
  118. exportButton.onPress = function() {
  119.     ds1.text = questionText;
  120.     ds1.feedbackTrue = feedbackCorrect;
  121.     ds1.feedbackFalse = feedbackIncorrect;
  122.     ds1.first();
  123.     for (i=1; i<=currentQuestion; i++) {
  124.         fscommand("File.Copy", "Result=[SrcDir]maps\\"
  125. add ds1.mapname add ".swf," add [SrcDir] add testTitle add "\\maps\\"
  126. add ds1.mapname add ".swf");
  127.         ds1.next();
  128.     }
  129.     ds1.first();
  130.     ds2.first();
  131.     for (i=1; i<=currentQuestion; i++) {
  132.         do {
  133.             tempHotspotString = "<hotspot><id>"+ds2.id+"</id><locx>"+ds2.locx+"</locx><locy>"+ds
  134. 2.locy+"</locy><isCorrect>"+ds2.correct+"</isCorrect></hotspot>";
  135.             hotspotString = hotspotString+tempHotspotString;
  136.             tempHotspotString = "";
  137.             ds2.next();
  138.         } while (ds2.qid === ds1.id && ds2.hasNext());
  139.         tempBuildXML = "<question><id>"+ds1.id+"</id><text>"+ds1.text+"</text><mapnam
  140. e>"+ds1.mapname+"</mapname><feedbackTrue>"+ds1.feedbackTrue+
  141. "</feedbackTrue><feedbackFalse>"+ds1.feedbackFalse+"</feedbackFalse>"+hotspotString+"</question>";
  142.         buildXML = buildXML+tempBuildXML;
  143.         hotspotString = "";
  144.         ds1.next();
  145.     }
  146.     myXMLOutput = buildXML;
  147.     myXML = "<?xml version='1.0' encoding='UTF-8' ?
  148. ><geo><name>"+testTitle+"</name>"+myXMLOutput+"</geo>";
  149.     fscommand("File.Write", [SrcDir] add testTitle
  150. add "\\xml\\geo.xml," add myXML);
  151.     fscommand("File.Copy", "Result=[SrcDir]geographer.swf,[SrcDir]" add testTitle add "\\geographer.swf");
  152.     fscommand("File.Copy", "Result=[SrcDir]index.html,[SrcDir]"
  153. add testTitle add "\\index.html");
  154.     fscommand("File.Copy", "Result=[SrcDir]geo.html,[SrcDir]" add
  155. testTitle add "\\geo.html");
  156.     fscommand("File.Copy", "Result=[SrcDir]geo_alternate.html,
  157. [SrcDir]" add testTitle add "\\geo_alternate.html");
  158.     fscommand("File.Copy", "Result=[SrcDir]alternate.gif,[SrcDir]"
  159. add testTitle add "\\alternate.gif");
  160.     fscommand("File.Copy", "Result=[SrcDir]flash_detection.swf,
  161. [SrcDir]" add testTitle add "\\flash_detection.swf");
  162.     fscommand("quit");
  163. };


Geographer - Frame 1, Initialize
Code: [ Select ]
xml1.trigger();


Geographer - Frame 2. Main code
Code: [ Select ]
//
///////////load externals, set some properties and variables
isViewer = true;
frame.swapDepths(101);
currentQuestion = 1;
ds1.last();
qTotal = ds1.id;
ds1.first();
buttonNext.enabled = true;
buttonPrevious.enabled = false;
feedbackBkgnd._visible = false;
feedbackIcon._visible = false;
feedbackField._visible = false;
rows = 1;
function loadHotSpots() {
    ds2.last();
    rows = ds2.id;
    ds2.first();
    for (i=1; i<=rows; i++) {
        newHotspot = "hotspot"+i;
        hotspot.duplicateMovieClip(newHotspot, i);
        eval(newHotspot)._x = ds2.locx;
        eval(newHotspot)._y = ds2.locy;
        eval(newHotspot).myLabel = i;
        eval(newHotspot).onRelease = function() {
            spotLabel = int(this.myLabel);
            ds2.filtered = true;
            ds2.filterFunc = function(item:Object) {
                return (item.id === spotLabel);
            };
            if (ds2.isCorrect === "true") {
                feedbackBkgnd._visible = true;
                feedbackIcon._visible = true;
                feedbackIcon.gotoAndStop(1);
                feedbackField._visible = true;
                feedbackText = ds1.feedbackTrue;
            } else {
                feedbackBkgnd._visible = true;
                feedbackIcon._visible = true;
                feedbackIcon.gotoAndStop(2);
                feedbackField._visible = true;
                feedbackText = ds1.feedbackFalse;
            }
        };
        ds2.filtered = false;
        ds2.next();
    }
}
function clearHotSpots() {
    for (i=1; i<=rows; i++) {
        eval("hotspot"+i).removeMovieClip();
    }
}
buttonNext.onRelease = function() {
    qRoll(currentQuestion+1);
    buttonPrevious.enabled = true;
    if ((currentQuestion) === qTotal) {
        buttonNext.enabled = false;
    }
    feedbackBkgnd._visible = false;
    feedbackIcon._visible = false;
    feedbackField._visible = false;
};
buttonPrevious.onRelease = function() {
    qRoll(currentQuestion-1);
    buttonNext.enabled = true;
    if ((currentQuestion) === 1) {
        buttonPrevious.enabled = false;
    }
    feedbackBkgnd._visible = false;
    feedbackIcon._visible = false;
    feedbackField._visible = false;
};
buttonCloseFeedback.onRelease = function() {
    qRoll(currentQuestion+1);
    if (currentQuestion === qTotal) {
        buttonNext.enabled = false;
    }
};
//
///////////roll to question
function qRoll(qToLoad) {
    ds1.filtered = true;
    ds1.filterFunc = function(item:Object) {
        return (item.id === qToLoad);
    };
    currentQuestion = qToLoad;
    workArea.loadMovie("maps/"+ds1.mapname+".swf");
    thisQuestion = ds1.text;
    status = "Question "+qToLoad+" of "+qTotal;
    clearHotSpots();
    loadHotSpots();
}
qRoll(1);
stop();
  1. //
  2. ///////////load externals, set some properties and variables
  3. isViewer = true;
  4. frame.swapDepths(101);
  5. currentQuestion = 1;
  6. ds1.last();
  7. qTotal = ds1.id;
  8. ds1.first();
  9. buttonNext.enabled = true;
  10. buttonPrevious.enabled = false;
  11. feedbackBkgnd._visible = false;
  12. feedbackIcon._visible = false;
  13. feedbackField._visible = false;
  14. rows = 1;
  15. function loadHotSpots() {
  16.     ds2.last();
  17.     rows = ds2.id;
  18.     ds2.first();
  19.     for (i=1; i<=rows; i++) {
  20.         newHotspot = "hotspot"+i;
  21.         hotspot.duplicateMovieClip(newHotspot, i);
  22.         eval(newHotspot)._x = ds2.locx;
  23.         eval(newHotspot)._y = ds2.locy;
  24.         eval(newHotspot).myLabel = i;
  25.         eval(newHotspot).onRelease = function() {
  26.             spotLabel = int(this.myLabel);
  27.             ds2.filtered = true;
  28.             ds2.filterFunc = function(item:Object) {
  29.                 return (item.id === spotLabel);
  30.             };
  31.             if (ds2.isCorrect === "true") {
  32.                 feedbackBkgnd._visible = true;
  33.                 feedbackIcon._visible = true;
  34.                 feedbackIcon.gotoAndStop(1);
  35.                 feedbackField._visible = true;
  36.                 feedbackText = ds1.feedbackTrue;
  37.             } else {
  38.                 feedbackBkgnd._visible = true;
  39.                 feedbackIcon._visible = true;
  40.                 feedbackIcon.gotoAndStop(2);
  41.                 feedbackField._visible = true;
  42.                 feedbackText = ds1.feedbackFalse;
  43.             }
  44.         };
  45.         ds2.filtered = false;
  46.         ds2.next();
  47.     }
  48. }
  49. function clearHotSpots() {
  50.     for (i=1; i<=rows; i++) {
  51.         eval("hotspot"+i).removeMovieClip();
  52.     }
  53. }
  54. buttonNext.onRelease = function() {
  55.     qRoll(currentQuestion+1);
  56.     buttonPrevious.enabled = true;
  57.     if ((currentQuestion) === qTotal) {
  58.         buttonNext.enabled = false;
  59.     }
  60.     feedbackBkgnd._visible = false;
  61.     feedbackIcon._visible = false;
  62.     feedbackField._visible = false;
  63. };
  64. buttonPrevious.onRelease = function() {
  65.     qRoll(currentQuestion-1);
  66.     buttonNext.enabled = true;
  67.     if ((currentQuestion) === 1) {
  68.         buttonPrevious.enabled = false;
  69.     }
  70.     feedbackBkgnd._visible = false;
  71.     feedbackIcon._visible = false;
  72.     feedbackField._visible = false;
  73. };
  74. buttonCloseFeedback.onRelease = function() {
  75.     qRoll(currentQuestion+1);
  76.     if (currentQuestion === qTotal) {
  77.         buttonNext.enabled = false;
  78.     }
  79. };
  80. //
  81. ///////////roll to question
  82. function qRoll(qToLoad) {
  83.     ds1.filtered = true;
  84.     ds1.filterFunc = function(item:Object) {
  85.         return (item.id === qToLoad);
  86.     };
  87.     currentQuestion = qToLoad;
  88.     workArea.loadMovie("maps/"+ds1.mapname+".swf");
  89.     thisQuestion = ds1.text;
  90.     status = "Question "+qToLoad+" of "+qTotal;
  91.     clearHotSpots();
  92.     loadHotSpots();
  93. }
  94. qRoll(1);
  95. stop();


I think the viewer code maybe incomplete. I need to check where I've archived my production files.

This code was written by me, from scratch, so if you find anything useful, please feel free....
  • catil
  • Born
  • Born
  • catil
  • Posts: 4

Post 3+ Months Ago

:shock:
Wow - as I am not that familiar with Flash, I will spend a hard time going through all this, so don't expect a feedback so soon.

But if I can manage to do a few things for this project "myself" with parts of you code, I will credit your work in some way, of course.

Thanks again.
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

Thanks. ;)

I should mention that I'm using an intermediary tool to package the .exe call Flash-n-Pack. It gives me access to file and folder functions, organic window shapes and few other fucntions like program icons and stuff. Most of the FSCommands are working with this. So these won't help you.

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 21 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.