| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #31 (permalink) |
| Neuer User Registriert seit: Sep 2004
Beiträge: 2
|
Hallo und vielen Dank für das Tutorial, funzt soweit alles wunderbar. Als Extragimmick fände ich es aber toll, wenn der zentrierte Inhalt sich je nach Größe immer wieder selbst zentriert... Logisch wäre eine ständige Abfrage der Größe des Content_mc's, aber wie sowas auszusehen hat bleibt mir bisher leider schleierhaft... so wie bei den architekten halt... ;-) Danke, Gruß unterwürfiger grosskotz |
| | |
| | #32 (permalink) |
| Freelancer Registriert seit: Oct 2001 Ort: Germany - Berlin
Beiträge: 1.777
| Bild mit MovieClipLoader laden und als Hintergrund benutzen im target MovieClip
Die Stage hat eine Größe von 800 x 500 Pixel Code: import flash.display.*;
Stage.scaleMode = "noScale";
createEmptyMovieClip("target",this.getNextHighestDepth());
target.createEmptyMovieClip("bmc",target.getNextHighestDepth());
// Create a listener which will notify us when
// the bitmap loaded successfully
var listener:Object = new Object();
// Track the target
listener.tmc = target;
// If the bitmap loaded successfully we redraw the
// movie into a BitmapData object and then attach
// that BitmapData to the target movie clip with
// the smoothing flag turned on.
listener.onLoadInit = function(mc:MovieClip) {
//trace(target.bmc._width);
target.onRelease = function() {
trace('click');
trace(loader);
loader.unloadClip(target);
};
mc._visible = false;
bitmap = new BitmapData(mc._width, mc._height, true);
bitmap.draw(mc);
with (this.tmc) {
matrix = new Matrix();
repeat = true;
smoothing = false;
//deletes drawed stuff
clear();
beginBitmapFill(bitmap,matrix,repeat,smoothing);
moveTo(0,0);
lineTo(0,Stage.height);
lineTo(Stage.width,Stage.height);
lineTo(Stage.width,0);
lineTo(0,0);
endFill();
}
};
// Do it, load the bitmap now
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
url = "micky_maus.png";
loader.loadClip(url,target.bmc);
with (target) {
_x=Math.round((Stage.width/2)-(800/2)-(Stage.width-800));
_y = Math.round((Stage.height/2) - (500/2) -(Stage.height-500)) ;
}
var stage_obj:Object = new Object();
stage_obj.onResize = function() {
with (target) {
_x=Math.round((Stage.width/2)-(800/2)-(Stage.width-800));
_y = Math.round((Stage.height/2) - (500/2) -(Stage.height-500)) ;
matrix = new Matrix();
matrix.rotate(Math.PI/8);
repeat = true;
smoothing = false;
clear();
beginBitmapFill(bitmap,matrix,repeat,smoothing);
moveTo(0,0);
lineTo(0,Stage.height);
lineTo(Stage.width,Stage.height);
lineTo(Stage.width,0);
lineTo(0,0);
endFill();
}
}
Stage.addListener(stage_obj);
__________________ Sayn'it doin'it... YouTube Kanal von KOmaSHOOTER www.quake3stuff.de www.Roman-Pantring.de My Space Roman Pantring www.Flashdictionary.de.vu Geändert von komashooter (02-07-2009 um 01:52 Uhr) |
| | |
| | #33 (permalink) | |
| Freelancer Registriert seit: Oct 2001 Ort: Germany - Berlin
Beiträge: 1.777
| Zitat:
| |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |