Zurück   Flashforum > Flash > ActionScript > ActionScript 2

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 17-05-2011, 21:45   #1 (permalink)
Neuer User
 
Registriert seit: May 2011
Ort: Hudiksvall - Sweden
Beiträge: 4
onEnterFrame problem

Please help me solve this.
Check out this code below.

PHP-Code:
import com.actionscript.text.TextScript1;
import com.actionscript.text.TextScript;
import flash.filters.DropShadowFilter;
import flash.filters.BlurFilter;
import mx.utils.Delegate;

var 
tf:TextFormat = new TextFormat();
tf.font="Arial Black";
tf.bold true;
tf.size 36;
//tf.color = 0x55FF55;
m.field.setTextFormat(tf);
var 
myDropFilter = new DropShadowFilter();
myDropFilter.blurX 25;
myDropFilter.blurY 10;
myDropFilter.angle 180;
myDropFilter.inner true;
myDropFilter.alpha 100;
myDropFilter.color 0xFF0000;
var 
myFilters:Array = m.field.filters;
myFilters.push(myDropFilter);
m.field.filters myFilters;

var 
tf1:TextFormat = new TextFormat();
tf1.font="Arial Black";
tf1.bold true;
tf1.size 36;
//tf.color = 0x55FF55;
m.field.setTextFormat(tf1);
var 
myDropFilter = new DropShadowFilter();
myDropFilter.blurX 25;
myDropFilter.blurY 10;
myDropFilter.angle 180;
myDropFilter.inner true;
myDropFilter.alpha 100;
myDropFilter.color 0xFF0000;
var 
myFilters:Array = m.field.filters;
myFilters.push(myDropFilter);
m.field.filters myFilters;



rotateIn = function() {
       if(
this.frameCount++ > this.delay) {
           
this.onEnterFrame = function() {
               
this.frameCount += 2;
               var 
n:Number 30 - (this.frameCount this.delay);
               
this.filters = [new BlurFilter(nn1)];
               
this._visible true;
               
this._alpha 100 - (3);
               if(
1) {
                   
this._alpha 100;
                   
this.onEnterFrame undefined;
               }
           }
       }
   }

dropInTransition = function() {
       if(
this.frameCount++ > this.delay) {
           
this._yTarget this._y;
           
this._y = -this._height Stage.height;
           
this._visible true;
           
this._velocity 0;
           
this._gravity 2;
           
this.onEnterFrame = function() {
               
this._velocity += this._gravity;
               
this._y += this._velocity;
               
this.filters = [new BlurFilter(0Math.abs(this._velocity), 1)];
               if(
this._y this._yTarget) {
                   
this._y this._yTarget;
                   if(
this._velocity 2) {
                       
this.filters = [];
                       
this._y this._yTarget;
                       
this.onEnterFrame undefined;
                   }
                   
this._velocity = -this._velocity/3.5;
               }
           }
       }
   }

var 
frameCounter:Number 0;
this.onEnterFrame = function() {
    if(
frameCounter++ % 70 == 0) {
        
m.removeMovieClip();
        
TextScript1.createEffect(this"Hello World!"5010tf2rotateIn);
         
delete this.onEnterFrame;
    }
}

var 
frameCounter1:Number 0;
this.onEnterFrame = function() {
    if(
frameCounter1++ % 70 == 0) {
        
w.removeMovieClip();
        
TextScript.createEffect1(this"Hello Wor!"5025tf12dropInTransition);
         
delete this.onEnterFrame;
    }

It works and is seen on
PHP-Code:
this.onEnterFrame function = function() {
    if(
frameCounter1++ % 70 == 0) { 
at the bottom and not above it
PHP-Code:
this.onEnterFrame function = function() {
    if(
frameCounter++ % 70 == 0) { 
.

Why are not both this.onEnterFrame functions together.
How can I make both this.onEnterFrame to work.
Penor ist offline   Mit Zitat antworten
Alt 17-05-2011, 21:57   #2 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
You simply cannot have 2 onEnterFrame functions assigned to the same object at the same time.

Why don't you combine them?
I.e. write both conditions within 1 onEnterFrame function.
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 17-05-2011, 22:28   #3 (permalink)
Neuer User
 
Registriert seit: May 2011
Ort: Hudiksvall - Sweden
Beiträge: 4
A thank you to help me.
So I can't assign two onEnterFrame movie object in the same event.
Can you describe more about how I can use it more detailed, it you mean here .
Zitat:
Why don't you combine them?
I.e. write both conditions within 1 onEnterFrame function.
Shall I uses If (conditions) {} logical conditions in function.
Help me to solve this for me.
Penor ist offline   Mit Zitat antworten
Alt 18-05-2011, 08:59   #4 (permalink)
Flash Developer
 
Benutzerbild von luschn
 
Registriert seit: Aug 2004
Ort: Wien
Beiträge: 248
what about this:

PHP-Code:
var frameCounter:Number 0;
this.onEnterFrame = function() {
    if(
frameCounter++ % 70 == 0) {
        
m.removeMovieClip();
        
w.removeMovieClip();
        
TextScript1.createEffect(this"Hello World!"5010tf2rotateIn);
        
TextScript.createEffect1(this"Hello Wor!"5025tf12dropInTransition);
        
delete this.onEnterFrame;
    }

but why with modulo?
you could also replace the if with this:
PHP-Code:
if(frameCounter++ >= 70) { 
i would use module for repeated things, like: "every 5 times do this or that"
__________________
www.devils-heaven.com - programming and stuff

Geändert von luschn (18-05-2011 um 09:02 Uhr)
luschn ist offline   Mit Zitat antworten
Alt 18-05-2011, 15:56   #5 (permalink)
Neuer User
 
Registriert seit: May 2011
Ort: Hudiksvall - Sweden
Beiträge: 4
Smile

I did not understand sonar text explanation at once or several times readings, but when luschn described it with the codes as I understood it better. I suppose sonar would also explain with codes in the same way who luschn. I find it hard to understand the text descriptions instead goes it better with pictures or codes.
Thank you for help me luschn.
Penor 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


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
onEnterFrame Problem samsonite1 ActionScript 2 3 29-01-2011 23:12
onEnterFrame Problem alpharay Flash Einsteiger 2 13-11-2006 17:11
onEnterFrame problem 4r4gorn ActionScript 1 1 04-05-2005 18:05
Problem mit onEnterFrame KaffDaddy ActionScript 1 14 09-09-2004 14:30
onEnterFrame - Problem greedie ActionScript 1 2 29-06-2004 11:12


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

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


Copyright ©1999 – 2012 Marc Thiele