• beyond tellerrand – play. Register Now!
Zurück   Flashforum > Flash > Flash Fortgeschritten > Flash 8

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 14-05-2007, 07:59   #1 (permalink)
no pain, no game!
 
Registriert seit: Oct 2002
Ort: berlin
Beiträge: 19
Rotations Menu Variation

Hi Folks,

ich versuche mich gerade an einer kleinen Variation des klassischen 3d Rotations-Menu.

Das Grund-Skript habe ich mir aus einem Beispiel von flashstar.de geholt:

http://flashstar.de/fla/mx/fs3dmxmenuv3.swf

In meiner Variante soll das Ganze nun nicht per Mausposition gedreht werden, sondern per Buttons "durchgeschaltet" werden.

In meinen Versuchen klappt das bisher nur mit Abstrichen. Die Abfrage der Position ist einfach zu ungenau.

Der große Held in Trigonometrie bin ich auch nicht. Kann mir jemand helfen bzw. kennt jemand ein Tutorial/Link mit Hilfe? Wäre der Hit!

Muchas Gracias!!!

Hier der Beispiel-Code:
(Hab das Ganze zwar noch in Klassen, aber hier gehts ja ums Prinzip)

PHP-Code:
fscommand("allowscale""false");
//var n:Number = Math.PI / 2;


// Menüeinträge
links = new Array();
links[1] = ["http://www.flashstar.de","Flashstar"];
links[2] = ["http://www.flashangel.de","Flashangel"];
links[3] = ["http://www.flashpower.de","Flashpower"];
links[4] = ["http://www.multimedia.de","Multimedia"];

// Bühnen Breite + Höhe
posX Stage.width 2;
posY Stage.height 2;

// Clips Erzeugen
anzahl links.length 1;
for (var 
1anzahl 1i++) 
{
    
attachMovie("clip""clip" ii);
}
//Base vars
dir     0;
dummy_count     0;
count    0;
count_step 0;
y_radius 100;
x_radius 200;

// Winkelgab für rotaton festlegen 
step    = ((360 anzahl + (360 anzahl)) * Math.PI) / 180;

function 
startRotation(dir:Number)
{
    
_root.onEnterFrame =  function()
    {
        
_root.rotate(_root.dir);
    }
}

this.next.onRelease = function ()
{
    
_root.dir     1;
    
startRotation(1);
}

this.prev.onRelease = function ()
{
    
_root.dir = -1;
    
startRotation(-1);
}

function 
stopRotation()
{
    
delete _root.onEnterFrame;
}

rotate = function(dir:Number)
{    
    var 
check = ((countStep + (360 anzahl)) * Math.PI) / 180;

    if(
check _root.step)
    {
        
_root.count 0;
        
_root.countStep 0;
        
_root.stopRotation();
        
        return;
    }
    
    
dummy_count += 10 dir;
    
countStep     += 10;
    
    for (var 
1anzahl 1i++) 
    {
        
winkel = ((dummy_count + (360 anzahl i)) * Math.PI) / 180;
        
        
//winkel = (((360 / anzahl * i)) * Math.PI) / 180;
        
        
this["clip" i]._x         posX + (Math.sin(-winkel) * x_radius);
        
this["clip" i]._y         posY + (Math.cos(-winkel) * y_radius);
        
this["clip" i]._xscale     100 + (Math.cos(winkel) * y_radius)
        
this["clip" i]._yscale     100 + (Math.cos(winkel) * y_radius);        
        
this["clip" i].swapDepths(1000 + (Math.cos(winkel) * y_radius));
        
this["clip" i].txtName links[i][1].toUpperCase();
    }
}

// MX (Logo)
planet.swapDepths(999 1); 
__________________
--
weitermachen
derrabe ist offline   Mit Zitat antworten
Alt 14-05-2007, 08:06   #2 (permalink)
no pain, no game!
 
Registriert seit: Oct 2002
Ort: berlin
Beiträge: 19
hier noch die fla zum ausprobieren...
Angehängte Dateien
Dateityp: zip fs3dmxmenuv3_chris.zip (4,7 KB, 18x aufgerufen)
__________________
--
weitermachen
derrabe ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 19:12 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele