Zurück   Flashforum > Flash > Flash Fortgeschritten > Flash CS4 Professional

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 12-01-2011, 10:35   #1 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 31
horizontale Navigation/Anpassung an Bildschirmauflösung

Hallo zusammen!
Kann mir jemand sagen oder einen Hinweis geben wie auf folgender Website, die Navigation und die Anpassung der swf an die Bildschirmauflösung umgesetzt wurde.
Milieubewust besparen op uw printkosten.
Ist das überhaupt Flash das die horizontale Navigation nach links und rechts steuert um den ganzen Klassenraum sehen zu können, oder vielleicht javascript?
Ich benutze die Auflösung 1024x768.
Danke!
Spher77 ist offline   Mit Zitat antworten
Alt 15-01-2011, 02:40   #2 (permalink)
Neuer User
 
Registriert seit: Jan 2011
Beiträge: 1
all flash (AS2)

Hi Spher

in english I'm afraid - it's all flash AS2.
I'm the one who made the site you referred to (how did you find it?) and since I've learned all I know from forums like these...
here's the 2 snippets of code you are looking for:

// scale to browser:
ScalefactorY=Math.round((Stage.height/mc_MyMovie._height)*100);
//ScalefactorX=Math.round((Stage.width/mc_MyMovie._width)*100);

mc_MyMovie._xscale=ScalefactorY;
mc_MyMovie._yscale=ScalefactorY;
mc_MyMovie._y=0;
mc_MyMovie._x=-150;


// this makes sure the movieclip resizes if the user resizes the browser window after the initial load:

var stageL:Object = new Object();
stageL.onResize = function() {
ScalefactorY=Math.round((Stage.height/mc_MyMovie._height)*100);
// ScalefactorX=Math.round((Stage.width/mc_MyMovie._width)*100);

mc_MyMovie._xscale=ScalefactorY;
mc_MyMovie._yscale=ScalefactorY;
mc_MyMovie._y=0;
mc_MyMovie._x=0;
}

Stage.addListener(stageL);


+++++++++++++++++++

for the horizontal navigation:
I used 3 states left right and middle, but you can create as many as you want.

first create a movieclip mc_MyMovie with the picture in it, with the mc registration point in the upper left corner of the image.

then create two mc's mc_btn_pan_right and mc_btn_pan_left,
just draw a little square filled with white at 0%
again registration point in upper left corner.

then add this code in a new layer:

mc_btn_pan_right._width=100;
mc_btn_pan_right._height=Stage.height;
mc_btn_pan_right._x=Stage.width-100;
mc_btn_pan_right._y=0;

mc_btn_pan_left._width=100;
mc_btn_pan_left._height=Stage.height;
mc_btn_pan_left._x=0;
mc_btn_pan_left._y=0;

mc_btn_pan_right.onRollOver = function() {
constrainedMove_right(mc_MyMovie, 4, 1);
};

mc_btn_pan_left.onRollOver = function() {
constrainedMove_left(mc_MyMovie, 4, 1);
};


function constrainedMove_right(target:MovieClip, speed:Number, dir:Number) {
target.destX = Math.round(-(mc_MyMovie._width-Stage.width));
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else {
target._x += Math.ceil((target.destX-target._x)*(speed/100));
}
}
mc_btn_pan_right._visible=false;
mc_btn_pan_left._visible=true;
}

function constrainedMove_left(target:MovieClip, speed:Number, dir:Number) {
var mousePercent:Number = _xmouse/Stage.width;

target.destX = 0;
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else {
target._x += Math.ceil((target.destX-target._x)*(speed/100));
}
}
mc_btn_pan_right._visible=true;
mc_btn_pan_left._visible=false;
}

function constrainedMove_middle(target:MovieClip, speed:Number, dir:Number) {
target.destX = Math.round(-((mc_MyMovie._width-Stage.width)/2));
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else {
target._x += Math.ceil((target.destX-target._x)*(speed/100));
}
}
mc_btn_pan_right._visible=true;
mc_btn_pan_left._visible=true;
}


hopes this works for you.
There probably is an easier way or some classes that do all this for you,
but it works for me.

what are you working on?

FYI: building the paper class room: http://beshartblog.blogspot.com/2010...t-website.html

Geändert von beshart (15-01-2011 um 03:02 Uhr)
beshart ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
bildschirmauflösung, horizontale navigation

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


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[Flash CS3] Anpassung der Bildschirmauflösung bei Offliniepräsentationen mdvision Flash Einsteiger 4 03-03-2009 13:10
Horizontale Navigation xdream1328 Flash Einsteiger 1 08-07-2008 17:26
horizontale navigation mit unterpunkten theDReamer Flash Einsteiger 0 17-06-2008 17:34
Horizontale Navigation kobo1 Flash Einsteiger 4 09-11-2006 14:36
horizontale navigation Thunderrace Flash 4 und Flash 5 8 28-07-2002 18:02


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:31 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele