Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 05-04-2004, 21:21   #1 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
Bildergallerie: PHP soll bilder-Größe auslesen (2)

Hallo,

für alle, die den vorhergehenden Thread nicht gelesen haben:


Ich will mir eine php-Datei bauen, die mir ausgibt, wie groß (Breite/Höhe) die Bilder sind, die in Flash eingeladen werden.

Mittlerweile funktioniert das auch schon einigermaßen, der "Weiter"-Button geht noch nicht!

Das AS:
ActionScript:
  1. directory = "coca-cola";
  2. fotonr = 0;
  3. path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  4.  
  5. container.loadMovie(path);
  6. this.loadVariables("filesize.php", "POST");
  7.  
  8.  
  9. next.onPress = function() {
  10.  
  11.     if(fotonr <= 1) {
  12.         fotonr++;
  13.     } else {
  14.         fotonr = 0;
  15.     }
  16.    
  17.     //directory = "coca-cola";
  18.     path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  19.    
  20.     container.loadMovie(path);
  21.     _parent.loadVariables("filesize.php", "POST");
  22.  
  23. };

Die PHP:
PHP-Code:
<?PHP

$php_path 
$_POST['path'];
$image_size GetImageSize("$php_path");

$hoch urlencode($image_size[1]);
$breit urlencode($image_size[0]);

echo 
"&pic_h=$hoch";
echo 
"&pic_w=$breit";



?>
Und das Attachment.
Angehängte Dateien
Dateityp: zip bildersize.zip (31,2 KB, 20x aufgerufen)
__________________
Mediendesign-Student
johanness ist offline   Mit Zitat antworten
Alt 05-04-2004, 22:21   #2 (permalink)
Flashaholic
 
Benutzerbild von atothek
 
Registriert seit: Feb 2003
Ort: Berlin
Beiträge: 1.459
probier doch mal folgendes
ActionScript:
  1. _parent.loadVariables("filesize.php?"+new Date().getTime(), "POST");

da flash die geladenen daten cached und glaubt die daten hätten sich nicht geändert.
__________________
TVNEXT Solutions
atothek ist offline   Mit Zitat antworten
Alt 06-04-2004, 09:51   #3 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
@atothek: Geht leider nicht. Die Pfade sind das Problem.


So geht's:
ActionScript:
  1. _root.directory = "coca-cola";
  2. _root.fotonr = 0;
  3. _root.path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  4.  
  5. _root.container.loadMovie(path);
  6. _root.loadVariables("filesize.php", "POST");
  7.  
  8.  
  9. next.onPress = function() {
  10.  
  11.     if(_root.fotonr <= 1) {
  12.         fotonr++;
  13.     } else {
  14.         _root.fotonr = 0;
  15.     }
  16.    
  17.     //directory = "coca-cola";
  18.     _root.path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  19.    
  20.     _root.container.loadMovie(path);
  21.     _root.loadVariables("filesize.php", "POST");
  22.  
  23. };


Aber das finde ich sehr unschön mit dem _root vornde dran immer.
Gibt's nichts besseres?
__________________
Mediendesign-Student

Geändert von johanness (06-04-2004 um 09:53 Uhr)
johanness ist offline   Mit Zitat antworten
Alt 06-04-2004, 12:10   #4 (permalink)
Trace it Baby
 
Benutzerbild von maddy
 
Registriert seit: Dec 2001
Beiträge: 416
Hi!

Ich bin zwar noch ziemlicher noob was AS angeht aber kannst Du nicht mit onData überprüfen das die Variablen da sind und die vorherigen zuvor mit delete löschen? Vielleicht hilft dir das ja irgendwie...?

Gruß
Steffen
maddy ist offline   Mit Zitat antworten
Alt 06-04-2004, 14:15   #5 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
@Maddy: Das ist ganz gut ja! Danke



Mein Problem jetzt noch ist:
Alle Pfade sind absolut. Wenn ich den Movie einlade, entstehen sicher Komplikationen!
Wie kann ich dieses _root loswerden????
Danke!
__________________
Mediendesign-Student
johanness ist offline   Mit Zitat antworten
Alt 06-04-2004, 14:34   #6 (permalink)
Neuer User
 
Benutzerbild von K-Grabowski
 
Registriert seit: Jan 2003
Ort: Arminia!!!! Bielefeld
Beiträge: 1.138
ActionScript:
  1. directory = "coca-cola";
  2. fotonr = 0;
  3. path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  4.  
  5. container.loadMovie(path);
  6. this.loadVariables("filesize.php", "POST");
  7.  
  8.  
  9. next.onPress = function() {
  10.        
  11.         if(fotonr <= 1) {
  12.                 fotonr++;
  13.         } else {
  14.                 fotonr = 0;
  15.         }
  16.        
  17.         //directory = "coca-cola";
  18.         path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  19.        
  20.         container.loadMovie(path);
  21.         this._parent.loadVariables("filesize.php", "POST");// _parent würde sich auf die Zeitleiste unter dieser beziehen.
  22.        
  23. };
__________________
Wieviel hätte ich also für dieses Fahrzeug zu investieren???
K-Grabowski ist offline   Mit Zitat antworten
Alt 06-04-2004, 14:36   #7 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
Danke!
Wieso versteh ih das eigentlich immer nicht!?

Könnte mir das mal einer erklären ?
__________________
Mediendesign-Student
johanness ist offline   Mit Zitat antworten
Alt 06-04-2004, 14:36   #8 (permalink)
Neuer User
 
Registriert seit: Apr 2003
Beiträge: 644
Hey, weiso schreibt das nicht jemand noch so um das alle bilder, egal wie groß sie sind in der gleichen größe eingefügt werden wei bei einem forum das avatar und das dann als tut oder einfach so zum saugen anbietet?? ich könnte sowas gut gebrauchen.
jonny-noob ist offline   Mit Zitat antworten
Alt 06-04-2004, 14:39   #9 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
Weil ich ziehmliche highquality-bilder habe und im augenblick, an meiner version bastle!
Wenn's denn mal fertig sein sollte, hätte ich es ah als [Stuff] gepostet...
__________________
Mediendesign-Student
johanness ist offline   Mit Zitat antworten
Alt 06-04-2004, 14:47   #10 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
@Garbowski:

Könntest du evtl. die borderScal() Function auch noch anpassen? Ich hab das versucht, aber....

Danke!

ActionScript:
  1. // ------------ Pfad erstellen ------------ //
  2. directory = "coca-cola";
  3. fotonr = 0;
  4. path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  5. // ------------ Bild einladen und 'alphan' ------------ //
  6. picCont._alpha = 30;
  7. picCont.loadMovie(path);
  8. // ------------ Höhe und Breite des eingeladenen JPGs holen ------------ //
  9. this.loadVariables("filesize.php", "POST");
  10.  
  11.  
  12.  
  13. borderScal = function() {
  14.     picCont._alpha = 30;
  15.     this.onEnterFrame = function() {
  16.        
  17.         _parent.borderCont._width += (pic_w - _parent.borderCont._width)/10;
  18.         _parent.borderCont._height += (pic_h - _parent.borderCont._height)/10;
  19.        
  20.         hDiff = Math.abs((Math.ceil(_parent.borderCont._height) - pic_h));
  21.         wDiff = Math.abs((Math.ceil(_parent.borderCont._width) - pic_w));
  22.        
  23.         if(wDiff <= 1  && hDiff <= 1) {
  24.             _parent.borderCont._height = pic_h;
  25.             _parent.borderCont._width = pic_w;     
  26.             _parent.picCont._alpha = 99;
  27.             delete this.onEnterFrame;
  28.         }
  29.         updateAfterEvent();
  30.     };
  31. }
  32.  
  33.  
  34.  
  35. next.onPress = function() {
  36.     if(fotonr <= 1) {
  37.         fotonr++;
  38.     } else {
  39.         fotonr = 0;
  40.     }
  41.     path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  42.    
  43.     picCont.loadMovie(path);
  44.  
  45.     this._parent.loadVariables("filesize.php", "POST");
  46.    
  47.     borderScal();
  48. };
__________________
Mediendesign-Student
johanness ist offline   Mit Zitat antworten
Alt 06-04-2004, 15:02   #11 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
Hehe, habs jetzt selbst geschafft
ActionScript:
  1. // ------------ Pfad erstellen ------------ //
  2. directory = "coca-cola";
  3. fotonr = 0;
  4. path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  5. // ------------ Bild einladen und 'alphan' ------------ //
  6. this.picCont._alpha = 30;
  7. this.picCont.loadMovie(path);
  8. // ------------ Höhe und Breite des eingeladenen JPGs holen ------------ //
  9. this.loadVariables("filesize.php", "POST");
  10.  
  11.  
  12.  
  13. borderScal = function() {
  14.     // _root = this
  15.     this.picCont._alpha = 30;
  16.     this.onEnterFrame = function() {
  17.        
  18.         this.borderCont._width += (pic_w - this.borderCont._width)/10;
  19.         this.borderCont._height += (pic_h - this.borderCont._height)/10;
  20.        
  21.         hDiff = Math.abs((Math.ceil(this.borderCont._height) - pic_h));
  22.         wDiff = Math.abs((Math.ceil(this.borderCont._width) - pic_w));
  23.        
  24.         if(wDiff <= 1  && hDiff <= 1) {
  25.             this.borderCont._height = pic_h;
  26.             this.borderCont._width = pic_w;   
  27.             this.picCont._alpha = 99;
  28.             delete this.onEnterFrame;
  29.         }
  30.         updateAfterEvent();
  31.     };
  32. }
  33.  
  34.  
  35.  
  36. next.onPress = function() {
  37.     if(fotonr <= 1) {
  38.         fotonr++;
  39.     } else {
  40.         fotonr = 0;
  41.     }
  42.     path = "gallery/" add directory add "/foto" add fotonr add ".jpg";
  43.    
  44.     this._parent.picCont.loadMovie(path);
  45.  
  46.     this._parent.loadVariables("filesize.php", "POST");
  47.    
  48.     borderScal();
  49. };
__________________
Mediendesign-Student

Geändert von johanness (06-04-2004 um 15:06 Uhr)
johanness ist offline   Mit Zitat antworten
Alt 06-04-2004, 15:09   #12 (permalink)
Neuer User
 
Benutzerbild von K-Grabowski
 
Registriert seit: Jan 2003
Ort: Arminia!!!! Bielefeld
Beiträge: 1.138
ist doch garnicht so schwer das mit parent und this
__________________
Wieviel hätte ich also für dieses Fahrzeug zu investieren???
K-Grabowski ist offline   Mit Zitat antworten
Alt 06-04-2004, 15:23   #13 (permalink)
Flash & TYPO3
 
Registriert seit: Oct 2003
Ort: Bayern
Beiträge: 2.700
Ich musste mir immer erst das Level tracen lassen, dann gings
Wenn du dich mit loadVars auskennst: loadVariables -> Timing

das bereitet mir schon seit langer Zeit Kopfzerbrechen! Danke!
__________________
Mediendesign-Student
johanness 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:13 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele