Zurück   Flashforum > Flash > ActionScript > ActionScript 3

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 15-09-2009, 11:09   #1 (permalink)
Neuer User
 
Registriert seit: Jun 2006
Beiträge: 16
Per Loader geladenes SWF wird im FP nicht angezeigt, im Projektor schon?

Hallo Zusammen,

ich habe folgendes Problem, für welches ich auch in der Hilfe und durch Googlen keine Lösung gefunden habe:

Ich lade eine SWF-Datei per Loader-Klasse in mein Hauptmovie. Wenn ich den Hauptfilm aus Flash heraus teste, wird die SWF angezeigt. Aus einem Flashprojektor heraus auch. Leider funktioniert das nicht, wenn ich die Haupt-SWF direkt im Flashplayer starte - und somit auch nicht online.

Alle Dateien liegen im gleichen lokalen Verzeichnis, der Zugriff für lokale Dateien ist gestattet.

Bei dem zu ladenden SWF handelt es sich um einen in FlashDevelop erstellten Papervision3D-Cube - hat es vielleicht damit etwas zu tun (Neuland für mich)?

Ich bezeichne mich selber als fortgeschrittenen AS2-Programmierer; seit AS3 bin ich leider total aufgeschmissen

Danke & Viele Grüße,
Chris
spam2 ist offline   Mit Zitat antworten
Alt 15-09-2009, 13:53   #2 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
ohne script schwer was zu sagen wo es da hackt
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 15-09-2009, 13:58   #3 (permalink)
feel the force of flash
 
Benutzerbild von webber
 
Registriert seit: Nov 2001
Beiträge: 322
Prüf doch mal, welche Player-Version bei welcher Situation benutzt wird.
StandAlone- Browser- und Flash-Interner Player müssen nicht immer die gleichen sein. Wenn z.B. der Browser und der SA-Player ältere Versionen als der FlashPlayer sind, kann das schon ein Grund sein.

Andere Möglichkeiten wären dann noch Versionsunterschiede in den Kompilierten Dateien oder gar überschriebene Klassen.

Ich hatte auch vor Kurzem ein Projekt bei dem ich mit FDT entwickelt habe und ein Kollege die externen swf mit FlashDevelop. Der hatte andere Klassen mit gleichem Namen benutzt und meine damit überschrieben. Sehr merkwürdig, aber Tatsache

Grooce
webber
webber ist offline   Mit Zitat antworten
Alt 15-09-2009, 20:28   #4 (permalink)
Neuer User
 
Registriert seit: Jun 2006
Beiträge: 16
Hallo ihr zwei,

danke für eure schnellen Antworten!

@Rusty Cake:

Der Code der Haupt-SWF:

PHP-Code:


// Fake "_global"-Variable, die ich als AS2ler benötige um erstmal klarzukommen ;)

MoGlobal.g.myFakeGlobal "1";
var 
loader:Loader = new Loader();

//cube.swf = papervision cube

var urlrHome:URLRequest = new URLRequest("cube.swf");
loader.load(urlrHome);
loader.contentLoaderInfo.addEventListener(Event.COMPLETEmovieLoaded);
function 
movieLoaded(event:Event):void {
    
addChild(loader);
    }

//button zum entladen & neuladen der cube.swf mit anderen grafiken:

b1.addEventListener(MouseEvent.MOUSE_UPonBtn1Release);
function 
onBtn1Release(e:MouseEvent):void {
    
MoGlobal.g.myFakeGlobal "1";
    
    
loader.unload();
    var 
urlrHome:URLRequest = new URLRequest("cube.swf");
    
loader.load(urlrHome);
    
loader.contentLoaderInfo.addEventListener(Event.COMPLETEmovieLoaded);
    function 
movieLoaded(event:Event):void {
    
addChild(loader);
    }


Der Code der Papervision-SWF ist von http://papervision2.com/10-advanced-interactivity/

Die einzige Modifikation meinerseits ist, daß die Texturen über die Fake-_global-Variable geändert werden können:

PHP-Code:

/**
* ...
* @author Default
* @version 0.1
*/

package  {
    
import flash.display.DisplayObject;
    
import org.papervision3d.materials.BitmapFileMaterial;
    
import org.papervision3d.materials.utils.MaterialsList;
    
import org.papervision3d.events.InteractiveScene3DEvent;
    
import org.papervision3d.objects.primitives.Cube;
    public class 
Main extends PaperBase {
        private var 
frontMaterial:BitmapFileMaterial = new BitmapFileMaterial("bilder/"+MoGlobal.g.myFakeGlobal+"/1.jpg");
        private var 
backMaterial:BitmapFileMaterial = new BitmapFileMaterial("bilder/"+MoGlobal.g.myFakeGlobal+"/2.jpg");
        private var 
leftMaterial:BitmapFileMaterial = new BitmapFileMaterial("bilder/"+MoGlobal.g.myFakeGlobal+"/3.jpg");
        private var 
rightMaterial:BitmapFileMaterial = new BitmapFileMaterial("bilder/"+MoGlobal.g.myFakeGlobal+"/4.jpg");
        private var 
topMaterial:BitmapFileMaterial = new BitmapFileMaterial("bilder/"+MoGlobal.g.myFakeGlobal+"/5.jpg");
        private var 
bottomMaterial:BitmapFileMaterial = new BitmapFileMaterial("bilder/"+MoGlobal.g.myFakeGlobal+"/6.jpg");
        private var 
targetrotationX:Number 0;
        private var 
targetrotationY:Number 0;
        private var 
targetrotationZ:Number 0;
        private var 
tweening:Boolean false;
        private var 
cube:Cube;
        public function 
Main() {
            
init(550580);
        }
            
override protected function init3d():void {
            
// We need to be able to identify each side. We'll do this
            // by asssigning names to each material. During this process
            // we'll also make the materials interactive.
            
frontMaterial.interactive true;
            
frontMaterial.name "front";
            
backMaterial.interactive true;
            
backMaterial.name "back";
            
leftMaterial.interactive true;
            
leftMaterial.name "left";
            
rightMaterial.interactive true;
            
rightMaterial.name "right";
            
topMaterial.interactive true;
            
topMaterial.name "top";
            
bottomMaterial.interactive true;
            
bottomMaterial.name "bottom";
            
// ---------------------------------------------
            
cube = new Cube(new MaterialsList( {
                
frontfrontMaterial,
                
backbackMaterial,
                
leftleftMaterial,
                
rightrightMaterial,
                
toptopMaterial,
                
bottombottomMaterial
                
} ), 500500500333);
            
// Listen for the click:
            
cube.addEventListenerInteractiveScene3DEvent.OBJECT_PRESSonPress);
            
// Add to scene:
            
default_scene.addChild(cube);
        }
        private function 
onPresse:InteractiveScene3DEvent ):void {
            
// If the cube has been moved to the front:
            
if (tweening) {
                
// Let it rotate again
                
tweening false;
            }else {
                
// Find which rotation we need to be able to see
                // the face image:
                
switch(e.face3d.material.name) {
                    case 
"front":
                        
targetrotationX 0;
                        
targetrotationY 180;
                        
targetrotationZ 0;
                        
tweening true;
                        
                    break;
                    case 
"back":
                        
targetrotationX 0;
                        
targetrotationY 0;
                        
targetrotationZ 0;
                        
tweening true;
                        ;
                    break;
                    case 
"left":
                        
targetrotationX 0;
                        
targetrotationY = -90;
                        
targetrotationZ 0;
                        
tweening true;
                        
                    break;
                    case 
"right":
                        
targetrotationX 0;
                        
targetrotationY 90;
                        
targetrotationZ 0;
                        
tweening true;
                        
                    break;
                    case 
"top":
                        
targetrotationX 90;
                        
targetrotationY 0;
                        
targetrotationZ 0;
                        
tweening true;
                        
                    break;
                    case 
"bottom":
                        
targetrotationX = -90;
                        
targetrotationY 0;
                        
targetrotationZ 180;
                        
tweening true;
                        
                    break;
                }
            }
        }
        
override protected function processFrame():void {
            if (
tweening) {
                
// If a face has been clicked ++ 8.5 entspricht 500; 6.8 400
                
if (default_camera.zoom <6.8) {
                    
// If the camera isn't zoomed enough then zoom in a bit more:
                    
default_camera.zoom += Math.sqrt(6.8-default_camera.zoom)/5;
                }
                
// Test each rotation and rotate it towards the target rotation:
                // X axis:
                
if (cube.rotationX <targetrotationX) {
                    
cube.rotationX += Math.sqrt(targetrotationX-cube.rotationX);
                    
cube.rotationX Math.round(cube.rotationX);
                }else if (
cube.rotationXtargetrotationX) {
                    
cube.rotationX -= Math.sqrt(cube.rotationX-targetrotationX);
                    
cube.rotationX Math.round(cube.rotationX);
                }
                
// Y axis:
                
if (cube.rotationY <targetrotationY) {
                    
cube.rotationY += Math.sqrt(targetrotationY-cube.rotationY);
                    
cube.rotationY Math.round(cube.rotationY);
                }else if (
cube.rotationYtargetrotationY) {
                    
cube.rotationY -= Math.sqrt(cube.rotationY-targetrotationY);
                    
cube.rotationY Math.round(cube.rotationY);
                }
                
// Z axis:
                
if (cube.rotationZ <targetrotationZ) {
                    
cube.rotationZ += Math.sqrt(targetrotationZ-cube.rotationZ);
                    
cube.rotationZ Math.round(cube.rotationZ);
                }else if (
cube.rotationZtargetrotationZ) {
                    
cube.rotationZ -= Math.sqrt(cube.rotationZ-targetrotationZ);
                    
cube.rotationZ Math.round(cube.rotationZ);
                }
            }else {
                
// If the camera is zoomed in, it shouldn't be now
                
if (default_camera.zoom2) {
                    
// So zoom out a bit.
                    
default_camera.zoom -= Math.sqrt(default_camera.zoom-2)/5;
                }
                
// Rotate the cube a bit:
                
cube.rotationX += 2;
                
cube.rotationY += 2;
                
// Make sure that we dont "wind up" the rotation
                
if (cube.rotationX>= 360cube.rotationX 0;
                if (
cube.rotationY>= 360cube.rotationY 0;
            }
        }
    }

@webber:

Browserplayer ist 10, SA-Player ist 9 r45, meine Flashversion ist CS3.

Danke & Grüße,
Chris
spam2 ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
as3, external swf, loader, papervision3d

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
in projektor geladenes swf funktioniert nicht mehr don.fernando ActionScript 1 3 19-03-2009 21:27
Extern geladenes Bild wird nicht angezeigt matzze2000 Flash Einsteiger 3 05-04-2007 16:19
[Loader]Eingebundene Objekte (vgl. Bibliothek) werden nicht angezeigt feder ActionScript 2 1 18-09-2006 05:30
geladenes *.txt file wird nur im IE angezeigt ramshazar ActionScript 1 3 20-01-2006 08:34
Text (static) wird wird nach loadmovie nicht mehr angezeigt?! muschko Flash MX 2004 21 10-11-2004 13:05


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:29 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele