« Adobe Sponsored Poker Event - Part DeuxUpdate: Using a GPRS, 3G or HSDPA Mobile with eee PC »

17 comments

  1. § Tuomas Artman said on :
    Yeah, it's a major downer... I used the same approach when I first stumbled upon the problem. However, I quickly noticed that for some #%&! reason the render event is not thrown about 1/10 of the time. Huh. And this was with wmode=window. The only solution I found was to listen to the ADDED-event on the parent display object and after each event go through the display list to see whether it was fired by the display object I was waiting for...
  2. § Scottae said on :
    I had a similar issue recently. I hate it.

    http://flashmove.com/forum/showthread.php?t=33081
  3. § Richard Leggett® Email said on :
    Wow that's really bad news. I was trying to avoid having to listen to the ADDED for each child as it would quickly become unruly. I hope this problem was not experienced in player 9.0.115.0? (Which is the version I'm going to be requiring for Flash 9 content).
  4. § hs said on :
    I remember another approach, I think the trick was to add a function with addFrameScript on that particular frame.
  5. § bob said on :
    Brilliant work Adobe. AS3 is sounding like a real joy for those who still use Flash and haven't eaten that lumpy flex cool aid residue.
    I can't express how much this RIA only mind set annoys me. You are totally alienating your core demographic with this OTT "real" coding bull shite.
  6. § Goldstone said on :
    Just wanted to add that the suggestion in comment 4 worked for me. Example:

    mc.gotoAndStop(2);
    addFrameScript(1, function () { });
  7. § Richard Leggett® Email said on :
    Thanks for the suggestion. Unfortunately addFrameScript() doesn't yet support frame labels so I can't use it in this case.
  8. § phpnuke said on :
    That is a downer.
  9. § Barliesque said on :

    Eureka! I've found a dependable solution, which I'm pleased to share with you...



    private var label:String;

    public function LabelButton(_labelText:String) {
    labelText = _labelText;

    for (var i:uint = 1; i < totalframes ; i++) {
    addFrameScript(i-1, frameScript); // , false, false);
    }
    }

    protected function frameScript() {
    this["label"].text = labelText;
    }
  10. § Barliesque said on :
    Oops. In my excitement, the sample code I threw together in my previous post had a couple of hiccups. Here's a revised edition...

    public class LabelButton extends MovieClip {

    private var labelText:String;

    public function LabelButton(_labelText:String) {
    labelText = _labelText;

    for (var i:uint = 0; i < totalframes ; i++) {
    addFrameScript(i, frameScript);
    }
    }

    protected function frameScript() {
    this["label"]["text"] = labelText;
    }
    }

    t listeners. While scouring the internet for a solution, I found this undocumented function addFrameScript() which allows you to apply code to a frame, in the same manner as the Actions panel in the Flash IDE. This frameScript is the *ONLY* opportunity I've found for executing code at the proper moment. With the above code, you can have your dynamic label with keyframes.
  11. § Barliesque said on :
    Heh heh. Okay, I ran myself round in so many circles looking for a solution, I somehow missed or forgot about the discussion of addFrameScript() above. So my solution is simply to apply a very light weight function call to *EVERY* frame--whether it's a keyframe or not--to keep the custom label always applied. (I wouldn't want to apply labels to every keyframe anyway.)
  12. § Rob said on :
    In regard to comments 6 & 7 by Goldstone and Richard Leggett.

    "Thanks for the suggestion. Unfortunately addFrameScript() doesn't yet support frame labels so I can't use it in this case."

    Why couldn't you do this:

    mc.gotoAndStop("frameLabel");
    var curFrame:int = mc.currentFrame;
    addFrameScript(curFrame, function () { });

    If that is what you meant.

    Cheers.
    R.
  13. § Daniel said on :
    Another simple solution, is to place frame scripts on the actual frames that call functions within the class...

    This is probably the easiest way to handle it since most of the thread handling will be handled by flash..
  14. § b Email said on :
    this doesn't work for me
    mc.gotoAndStop(2);
    mc.addFrameScript(1, function () { });

    do I really have to go to frame 2
    and then add a frame script on frame 1???
    (in any case it doesn't work)

    AS3 is a pain in the Ass...ok it's "powerful" but who cares!!! we want fast development here!!!...no super ultra rigid constraints!! I agree with bob: too much attention to RIA dev led adobe to forget its main target...
    I am an experienced designer and programmer with a few Flash Apps on his back...i tell you: AS3 sucks! (I'm sorry to say that!)

    is it possible that such a simple thing as a mc timeline and its content (that has worked for the past 8 versions) now can't be addressed via code...without a deprecable workaround!!!?!?! unbelievable!! they should read pragmatic programming at adobe!

    in the future I will use AS3 only when I need to use papervision!
    rants off :)
    I'll try the Event.RENDER solution
  15. § b Email said on :
    I solved the problem without the need of any of the two workarounds

    for me the problem was that inside the mc there was a label who wasn't accesible only the SECOND TIME that the timeline went back to frame 1.
    so mc.myTextField was yielding the infamous ERROR 1009
    Cannot access a property or method of a null object reference
    (again, only on the second round)

    To solve the issue
    - I ensured that the textfield had no blank frames..and that was "alive" for the whole timeline..
    If you have to make it disappear, bring it to alpha 0 and leave the frame alive untill the end of the mc
    - ensure that at every keyframe your child object (in this case the textField) has the same identical instance name
    (for a distraction I had one of the keyframes with a different instance name without noticing.)

    I dind't have to use the Event.RENDER-ivalidate ignoble workaround!
    nor the addFrameAction
    nor I will try to need it in the future (screw AS3)
    ;)
  16. § Bruce Email said on :
    Here's a class I threw together that uses the ignoble render event and stage.invalidate() method. This class allows you to specify a complete function and pass parameters

    Get the class here:
    http://www.brucebranscom.com/classes/Utils.as

    Usage:

    //this only needs to be called once every application
    Utils.setStage( stage );

    Utils.gotoAndPlay( myMC, "frameLabel", completeFunction );

    function completeFunction():void
    {
    you can access myMC's children here
    }


  17. § Nicholas Livadas Email said on :
    Simple solution:

    1) first frame inside of the target movieclip in library
    var fooText:String = "";

    2) second frame inside of the target movieclip in library
    TextField(this.getChildAt(1)).text = fooText;

    3) Now from anywhere you are accessing the target
    target.fooText = barText;
    target.gotoAndStop(2);

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
Contact. ©2009 by Richard Leggett. blog software / UK hosts / monetize.
Design & icons by N.Design Studio. Skin by Tender Feelings / EvoFactory.
Entries RSS Comments RSS Log in