HZGN.COM
welcome to my space
X
Feng Shui | Graphic Design | Cosmetics | Causes and Organizations | Regulatory Compliance | Gadgets and Gizmos | Computer Forensics | Tools and Equipment | Related articles
Search:  
Welcome to:hzgn.com
 HOME   onEnterFrame executes only once ?!?!
onEnterFrame executes only once ?!?!
Published by: cfz 2009-01-08

  • I'm loading dynamic images into a runtime MC, assigning a simple onEnterFrame function to make it scroll by, and am amazed that it won't work. This should be an exceedingly simple thing to accomplish, but I'm guessing that there's some issue with loading an external image/movie or maybe the fact that it's all at runtime... Anyway, just can't figure out why this won't work. Any thoughts, fixes or statements of the obvious (I think I have a slow brain-bleed at this point in this project) would be most appreciated...
    tripleaxis.com » Advanced Bar Preloader Tutorial::
    Jun 6, 2008 The onEnterFrame event is fired each time the movie enters a new frame the code inside our function will be executed once every frame.
    http://www.tripleaxis.com/blog/?p=90
    HOME

    Ciao,

    -Jei.


  • use the timeline's onEnterframe's
    do either
    _root.onEnterFrame or this.onEnterFrame


  • post your FLA


  • Thanks, guys. Okay, that makes sense that it's being overwritten, but it still seems that something else is going on. As a test, I removed my onEnterFrame function and put the action in a button's onPress, and the movement still didn't work. Here's my current loading function. Is there a better way of doing this (I guess that's an obvious "yes" :te:)?
    onEnterFrame (MovieClip.onEnterFrame handler) -- Flash CS3::
    Jul 19, 2008 You must define a function that executes when the event handler is Set the value of the onEnterFrame event handler to null once the
    http://livedocs.adobe.com/flash/9.0/main/00001945.html
    HOME
    Creating a digital alarm clock with a metal frame::
    Oct 13, 2008 Do this by pressing each key only once. .. otherwise, the sound will start playing each time the onEnterFrame function is executed (that
    http://flashexplained.com/design/creating-a-digital-alarm-clock-with-a-metal-frame/
    HOME


    function loadPics(){
    _root.attachMovie("picStrip", "picStrip", 100, {_x: 0, _y: 15});
    for (var i:Number =0;i<_root.prodCount;i++){
    _root.picStrip.picHolder.createEmptyMovieClip(("imgProd" + i), _root.picStrip.picHolder.getNextHighestDepth());
    _root.picStrip.picHolder["imgProd" + i]._x = (i * 223);
    _root.picStrip.picHolder["imgProd" + i]._y = 0;
    trace("loading pics: " + _root.prodNode.childNodes[i].attributes.image);
    trace("setting x to " + (i * 223));
    Math.random() Taken A Step Further - 13Dots Forum::
    5 posts - Last post: Mar 23, 2008So in summary I will execute the function everytime a button is So, once combined with the rest of our script we have the following:
    http://www.13dots.com/forum/index.php?showtopic=14725
    HOME
    _root.picStrip.picHolder["imgProd" + i].loadMovie(_root.prodNode.childNodes[i].attributes.image);
    _root.picStrip.picHolder["imgProd" + i].onEnterFrame = function(){
    trace("my x: " + _x);
    trace("my width: " + _width);
    if(_x < -223){
    trace("my x is less than 0");
    _x = 223 * (_root.prodCount - 1);
    }else{
    trace("my x is greater than 0");
    _x -= 1;
    }
    };
    }
    }


  • If you're using that clip to load the external content you're overwriting the onEnterFrame loop as soon as you do. As Celestial noted, put the onEnterFrame event somewhere that it isn't going to get loaded over.





  • Red Hat's Rough Recovery From CFO Exit
    Windows Live Finds a New, Pre-installed Home

    PRINT Add to favorites
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about onEnterFrame executes only once ?!?! , Please add it free.
    About us |Contact us |Advertisement |Site map |Exchange links
    Copyright© 2008hzgn.com All Rights Reserved