Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 29-04-2007, 10:57   #1 (permalink)
Neuer User
 
Registriert seit: Jan 2002
Ort: Tokyo (J)
Beiträge: 273
[CS3] Problem mit removeMovieClip()

Hallo allerseits

habe folgendes versucht, schien auch zu gehen, aber jetzt plötzlich nicht
mehr...bin mir sicher, dass ich an der Funktion selber nichts rumgeschraubt
habe seit dem letzten mal, habe lediglich ein bisschen mit Components
herumgespielt! Das komische ist, dass es mir immer nur das
_root.Info_msg.Info_box entfernt, egal was ich bei dem onRelease
event eingebe habe die möglichkeiten mal auskommentiert!!!
Diesen Code kann man direkt in ein neues Dokument
einfügen, sollte funktionieren!

ActionScript:
  1. _root.createEmptyMovieClip("btn",1);
  2. with(_root.btn){
  3.     beginFill(0x880000,30);
  4.     lineStyle(3,0xcccccc,100);
  5.     moveTo(100,100);
  6.     lineTo(100,200);
  7.     lineTo(200,200);
  8.     lineTo(200,100);
  9.     lineTo(100,100);
  10.     endFill();
  11. }
  12. _root.btn.onRelease = function(){
  13.     ShowInfo("Testtest","this is a tryout because it doesnt work and that sucks a lot :(",_root.txtf)
  14. }
  15.  
  16. _root.createTextField("txtf",2,10,10,50,20);
  17. with(_root.txtf){
  18.     border=true;
  19.     type = "input";
  20. }
  21.  
  22.  
  23. function ShowInfo(Infomsg_title, Infomsg, targetObj){
  24.     var IM = _root.createEmptyMovieClip("Info_msg",_root.getNextHighestDepth());
  25.     var DOBg = IM.createEmptyMovieClip("Info_Background",IM.getNextHighestDepth())
  26.     with(DOBg){
  27.         beginFill(0xcccccc,50);
  28.         lineStyle(1,0xcccccc,100);
  29.         moveTo(20,25);
  30.         lineTo(20,375);
  31.         lineTo(525,375);
  32.         lineTo(525,25);
  33.         lineTo(20,25);
  34.         endFill();
  35.     }
  36.     DOBg.onRollover = function(){};
  37.     DOBg.useHandCursor = false;
  38.    
  39.     var DOB = IM.createEmptyMovieClip("Info_Box",IM.getNextHighestDepth());
  40.     with(DOB){
  41.         beginFill(0xffffff,100)
  42.         lineStyle(1,0xcccccc,100)
  43.         box_x = 500;
  44.         box_y = 200;
  45.         moveTo(-(box_x / 2),-(box_y / 2));
  46.         lineTo((box_x / 2),-(box_y / 2));
  47.         lineTo((box_x / 2),(box_y / 2));
  48.         lineTo(-(box_x / 2),(box_y / 2));
  49.         lineTo(-(box_x / 2),-(box_y / 2));
  50.         endFill();
  51.         moveTo(-(box_x / 2) + 10,-(box_y / 2) + 30);
  52.         lineTo((box_x / 2) - 10,-(box_y / 2) + 30);
  53.         moveTo(-(box_x / 2) + 10,(box_y / 2) - 30);
  54.         lineTo((box_x / 2) - 10, (box_y / 2) - 30);
  55.        
  56.         _x = 275;
  57.         _y = 200;
  58.    
  59.         createTextField("t_Info_Title",getNextHighestDepth(),-(box_x / 2) + 10, -(box_y / 2) + 5, box_x - 20, 20)
  60.         with(t_Info_Title){
  61.             type = "static";
  62.             selectable = false;
  63.             //embedFonts = true;
  64.             text = Infomsg_title;
  65.             setTextFormat(txt_format);
  66.         }
  67.        
  68.         createTextField("t_Info_msg",getNextHighestDepth(),-(box_x / 2) + 10, -(box_y / 2) + 40, box_x - 20, 140)
  69.         with(t_Info_msg){
  70.             wordWrap = true;
  71.             multiline = true;
  72.             type = "static";
  73.             selectable = false;
  74.             //embedFonts = true;
  75.             html = true;
  76.             htmlText = Infomsg;
  77.             setTextFormat(txt_format);
  78.         }
  79.        
  80.         createEmptyMovieClip("MC_Exit",getNextHighestDepth())
  81.         with(MC_Exit){
  82.             moveTo(-(box_x / 2), (box_y / 2) - 30);
  83.             lineTo((box_x / 2), (box_y / 2) - 30);
  84.             lineTo((box_x / 2), (box_y / 2));
  85.             lineTo(-(box_x / 2), (box_y / 2));
  86.             lineTo(-(box_x / 2), (box_y / 2) - 30);
  87.            
  88.             createTextField("t_Exit",getNextHighestDepth(), -(box_x / 2) + 10,(box_y / 2) -25, box_x - 20, 20)
  89.             with(t_Exit){
  90.                 type = "static";
  91.                 selectable = false;
  92.                 //embedFonts = true;
  93.                 text = "exit";
  94.                 setTextFormat(txt_format);
  95.             }
  96.         }
  97.         MC_Exit.onRelease = function(){
  98.             Selection.setFocus(targetObj);
  99.             removeMovieClip(_root.Info_msg);
  100.             //removeMovieClip(_root.Info_msg.Info_Background);
  101.             //removeMovieClip(this._parent._parent);
  102.         }
  103.     }
  104. };//Done
  105.  
  106. txt_format = new TextFormat()
  107. with(txt_format){
  108.     font = "Verdana";
  109.     size = 18;
  110.     align = "center";
  111. }

Bin froh um jeden Input, steh ziemlich auf dem Schlauch!

Freundliche Grüsse

H.2.O
Hasch2o ist offline   Mit Zitat antworten
Alt 29-04-2007, 14:14   #2 (permalink)
................
 
Benutzerbild von Der Frager
 
Registriert seit: Jun 2004
Beiträge: 15.890
Zitat:
Zitat von Hasch2o Beitrag anzeigen
...habe lediglich ein bisschen mit Components
herumgespielt
Die Komponenten sorgen dafür, dass deine MovieClips auf unglaublich hohen Tiefen liegen und nicht mehr einfach zu removen sind.
Kannst aber z.B. swapDepths() benutzen:
PHP-Code:
irgendeinMC.swapDepths(1000)
irgendeinMC.removeMovieClip() 
__________________

ternärer Konditionaloperator

+++ Bitte keine Privat-Nachrichten bezüglich Flashfragen! +++
Der Frager ist offline   Mit Zitat antworten
Alt 29-04-2007, 14:51   #3 (permalink)
Neuer User
 
Registriert seit: Jan 2002
Ort: Tokyo (J)
Beiträge: 273
Hallo DerFrager

scheint mir aber komisch, dass dies dann in einem ganz neuen Dokument ebenfalls passiert!?

Werde es aber gleich mal ausprobieren.

Danke dir vielmals

H.2.O
Hasch2o ist offline   Mit Zitat antworten
Alt 29-04-2007, 14:54   #4 (permalink)
Neuer User
 
Registriert seit: Jan 2002
Ort: Tokyo (J)
Beiträge: 273
Hmmm....scheint immer noch nicht ganz zu klappen und wenn ich die Tiefe mit Hilfe von getDepth() versuche zu eruieren gibt er mir 0 aus!

Weitere Ideen?

Danke und Gruss

H.2.O
Hasch2o ist offline   Mit Zitat antworten
Alt 29-04-2007, 14:58   #5 (permalink)
................
 
Benutzerbild von Der Frager
 
Registriert seit: Jun 2004
Beiträge: 15.890
PHP-Code:
_root.Info_msg.removeMovieClip(); 
So geht's...
__________________

ternärer Konditionaloperator

+++ Bitte keine Privat-Nachrichten bezüglich Flashfragen! +++
Der Frager ist offline   Mit Zitat antworten
Alt 29-04-2007, 15:07   #6 (permalink)
Neuer User
 
Registriert seit: Jan 2002
Ort: Tokyo (J)
Beiträge: 273
Dachte ich hätte das ausprobiert! aber jetzt klappts!

Danke dir vielmals!

Gruss H.2.O
Hasch2o 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 03:06 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele