Ok.
We are having a lot of trouble figuring this project out. I do have to admit
that I am not as advanced with actionscripting as my partner is, but he is outa
town now and I am dieing for some answers!:)
We are trying to dynamically create these tenticals. We have it creating now
with I believe line segments.. Now, the more line segments we have the smoother
the curve, BUT if we plan on having multiple tenticals (which we do) this will
really bog down the processor. We also cannont figure a way to fill the inside
of the segments to make it a complete tentical..
check out our example of what we have now...
[L=WHat we have so far]
http://www.medianstudios.com/leo/waveNEW.html[/L]
here is the code:
waves = {};
waveCount = 0;
levelCount = 10;
function initWave(centerX, centerY, width, height, pointNum, amplitude) {
waves[waveCount] = {};
with (waves[waveCount]) {
x = centerX;
y = centerY+(height*2);
waveLen = width;
amp = amplitude;
waveThick = height;
totParts = pointNum-1;
totPoints = pointNum;
partLen = width/totParts;
points = {};
for (i=0; i<totPoints; i++) {
points[i] = {};
points[i].x = centerX+(i*partLen);
points[i].y = centerY;
}
for (j=0; j<2; j++) {
for (i=0; i<totParts; i++) {
tempName = String(j+"part"+i);
_root.attachMovie("part", tempName, levelCount++);
with (_root[tempName]) {
_x = points[i].x;
_y = points[i].y;
_width = partLen;
_height = partLen;
tempDiff = points[i+1].x-points[i].x;
_xscale = tempDiff*100;
}
}
}
}
waveCount++;
}
_root.onEnterFrame = function() {
with (waves[0]) {
count++;
for (i=0; i<totPoints; i++) {
tempAmp = amp*(i/totPoints);
points[i].val = tempAmp*Math.sin((count+i)/(.5*totPoints));
points[i].thick = (((totPoints-i)/totPoints))*waveThick;
points[i].part0 = points[i].val+points[i].thick-1;
points[i].part1 = points[i].val-points[i].thick+1;
}
for (j=0; j<2; j++) {
for (i=0; i<totParts; i++) {
tempName = j+"part"+i;
with (_root[tempName]) {
_y = points[i]["part"+j]+y;
tempDiff = points[i+1]["part"+j]-points[i]["part"+j];
_yscale = tempDiff*100;
}
}
}
}
};
//attributes or initWave() are:
//x, y, width, height, segments(lines), amplitude
initWave(100, 100, 300, 25, 20, 75);
we want to also be able to move the tenticals based on the mouse movement,
like your mouse is brushing them out of the way.. but that will just be easy
plug n chug formulas..
Thanks SO much!
-Robert Szyszlo