Zurück   Flashforum > Flash > ActionScript > ActionScript 2

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 08-02-2012, 16:26   #1 (permalink)
Neuer User
 
Registriert seit: May 2011
Ort: Hudiksvall - Sweden
Beiträge: 4
MovieClip, Function and Tween problem

I have two questions about two different things.

I begin with the first question.
Describes the first the thing.
I have a scene as there are photo albums for each image have I a MovieClip object.
The code looks like this:

PHP-Code:
var a24:MovieClip;
a4c_mc.onPress = function () {
_root.scrollMc.disable();
hiden.useHandCursor false;
hiden._visible true;    
a24 _root.attachMovie("fmap1""a24a"_root.getNextHighestDepth(), {_x:(Stage.width-565)/2_y:(Stage.height-492)/2});
a24._alpha 0;
checkImagea24();
};
checkImagea24 = function () {
_root.createEmptyMovieClip("begin04"_root.getNextHighestDepth());
_root.begin04.createTextField("ab1_txt"this.getNextHighestDepth(), ((Stage.width-a24._width)/2)+(a24._width-460)/258546020);
var 
my_fmt:TextFormat = new TextFormat();
my_fmt.font "_serif";
my_fmt.size 15;
my_fmt.bold true;
my_fmt.color 0xffffff;
_root.begin04.ab1_txt.text "Text Text Text Text Text Text Text Text";
_root.begin04.ab1_txt.setTextFormat(my_fmt);
_root.begin04.ab1_txt.setTextFormat(my_fmt);
_root.begin04.ab1_txt.selectable false;
_root.begin04.ab1_txt.wordWrap false;
_root.begin04.ab1_txt.background true;
_root.begin04.ab1_txt.backgroundColor 0x000000;
var 
myDropFilter = new DropShadowFilter();
myDropFilter.blurX 25;
myDropFilter.blurY 10;
myDropFilter.angle 180;
myDropFilter.inner true;
myDropFilter.alpha 100;
myDropFilter.color 0xFFFFFF;
var 
myFilters:Array = _root.begin04.ab1_txt.filters;
myFilters.push(myDropFilter);
_root.begin04.ab1_txt.filters myFilters;
var 
text1:Tween = new Tween(_root.begin04.ab1_txt"_alpha"None.easeNone01001true);
text1.onMotionStarted= function() {
_root.begin04.ab1_txt._visible true;
};
a24.cacheAsBitmap true;
            new 
Tween(a24"_alpha"Strong.easeOut01002true);
    
a24.useHandCursor false;
    
bgalpha._visible true;
a24.onPress = function () {
    
    
_root.begin04.ab1_txt._visible false;
    
bgalpha._visible false;
var 
myTween8:Tween = new Tween(a24"_alpha"Strong.easeOut10002true);
myTween8.onMotionFinished = function() {
    
    
a24.fmap1 stopTweens();

    
hiden._visible false;    
    
_root.scrollMc.enable();
a24.removeMovieClip();
_root.begin04.removeMovieClip();
};
    
a24.onPress undefined;
};
}; 
In this scene have I from a programmer taken this function
PHP-Code:
function stopTweens(target:MovieClip):Void {
    
target target || _level0;
    for (var 
i in target) {
        if (
typeof (target[i]) == "object" && target[i] instanceof Tween) {
            
target[i].stop();
        }
        if (
typeof (target[i]) == "movieclip") {
            
stopTweens(target[i]);
        }

    }

After image MovieClip object a24 goes up in code see here
PHP-Code:
a24 _root.attachMovie("map1""a24a"_root.getNextHighestDepth(), {_x:(Stage.width-565)/2_y:(Stage.height-492)/2});
.........
new 
Tween(a24"_alpha"Strong.easeOut01002true);
a24.onPress = function () {
.........
var 
myTween8:Tween = new Tween(a24"_alpha"Strong.easeOut10002true);
myTween8.onMotionFinished = function() {    
    
a24.map1 Tweenbl.stopTweens(); 
After I have clicked the MovieClip object a24 goes down but then freezes everything.
I then get in the Output window from Test Movie where I get the text
"256 levels of recursion were exceeded in one action list.
This is probably an infinite loop. Further execution of actions has been disabled in this movie."
In MovieClip object map1 have I several tween objects in one MovieClip object.
Then after I have clicked on the a24 so would I stop all Tween motion in MovieClip object map1 whatever.
When I click MovieClip object a24 again so shall be Movieclipt object map1 start over again.
How do I do it with the function stopTweens without other MovieClip with Tween be stopped.

I conclude with the second question.
If I have a scene that contains this code

PHP-Code:
function stopTweens(target:MovieClip):Void {
}

function 
starta() {
_global.c.onPress = function () {
    
Tweenbl.stopTweens();
    var 
black1:MovieClip _root.attachMovie("blackbg""black"_root.getNextHighestDepth(), {_x:0_y:0});
    var 
black2:Tween = new Tween(black1"_alpha"None.easeNone01003true);
    
black2.onMotionFinished = function() {

    
gotoAndStop("scene2")
    };
    }; 
How do I get the function stopTweens in this _global.c.onPress = function () { nested function.
Where c is MovieClip object.

Geändert von Penor (08-02-2012 um 16:33 Uhr)
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
Problem mit Tween-Event auf MovieClip veraee ActionScript 3 4 23-10-2007 12:31
Tween von BlurX und BlurY mit function medien_freak ActionScript 1 5 07-08-2007 10:09
function und tween trossen ActionScript 1 3 15-07-2005 09:52
tween plus function moreloga Flash MX 1 21-10-2004 12:38
tween function DRDK_EnvinyataR ActionScript 1 2 28-09-2003 02:26


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

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


Copyright ©1999 – 2012 Marc Thiele