Help with smooth scrolling (masked movie clip)

Ok, I really need help here, and I'll be very grateful for
help before Monday.
Someone has made a movie with a different set of text on each
frame, the text goes out of the viewable area.
I have been asked to make these frames appear in a pop-up on
another flash and be scrollable.
i thought this would be easy...just cut and paste them into a
movie clip, then using a mask to hide the rest of the text.
However, it is going painstakingly slow.
Seems to be a performance issue, but it might be my code.
Any help with the code, or optimisation elsewhere would be
helpfully.
Heres a simplified version of the flash;
www.darkflame.co.uk/flashwork/Flash_popuptest.fla
Code for the scrolling;
_global.MoveUp = function(text) {
_root.ITproduct.IT_productlist._y =
_root.ITproduct.IT_productlist._y+6;
updateAfterEvent();
//trace('press');
Called and stopped by;
on (press){
//this._parent.IT_productlist._y =
this._parent.IT_productlist._y +10;
//_global.scrollon = "yes";
clearInterval(IntervalID);
IntervalID = setInterval(MoveUp,100);
updateAfterEvent()
//updateAfterEvent();
//MoveUp();
//scroll on
on (release) {
//this._parent.IT_productlist._y =
this._parent.IT_productlist._y +10;
clearInterval(IntervalID);
updateAfterEvent();
//scroll off
which is linked to a button.
I dont know if this is a actionscript problem, or the way the
page is made, or both.
Any help would be appreciated.
Thanks in advance,
Thomas Wrobel

you have extraneous graphics on-stage that are slowing the
scrolling (and even causing problems in the authoring environment).
here's your file with those graphics removed:
http://www.gladstien.com/Files.popupTest.fla

Similar Messages

  • Need help with smooth scrolling of a sprite

    Hi All,
    Something that i have had many problems over the years with
    is creating the same nice smooth scrolling effect that i see on
    many sites (my scrolling always appears jerky in AS2 even when done
    on a movieClip with a high framerate - with onEnterFrame updates).
    At the moment i am building my first AS3 site, and want to
    use it as an opportunity to "do things right".
    So far i have a very simple setup that is scrolling a sprite
    that contains a series of loaded images based on the position of a
    scrollbar. As one would expect from something this simple - it is
    rather jerky.
    I tried a number of variations of using a Tween to do the
    scroll, and kill/update that tween when the mouse moves again.
    However in all cases the results were not good (multiple tweens
    seemed to still be active - so killing the tween wasn't working).
    So clearly i am doing something wrong.
    I have searched extensively, but have not come across any
    examples that seem appropriate (some predefined components - but
    that does not help me understand the fundamentals) . I have seen
    some examples that register a timer, and manually calculate the
    offset for each frame, is this the correct approach?
    Below is my existing simple (jerky) implementation.
    All help to understand how to make this scrolling smooth
    would be hugely appreciated.
    One more thing to add incase it is relevant, is that the
    contents of the Sprite are a series of jpg images loaded with the
    Loader class (although i plan on switching to using the BulkLoader
    class created by a developer in the AS3 community).

    nope. the approach for the smoothest tween would be to:
    1. initialize your parameters
    2. create your timer.
    3. add your timer's listener method when needed (when your
    slider is clicked).
    4. in your timer's listener function repeatedly poll the
    slider's position and update your sprite using the parameters
    determined in 1.
    5. remove your listener when the slider is released.

  • Deadline: 22 May 08H00 Help ME Please Scrolling a movie clip from the Centre

    Hi
    It has been a while since I have been here I am in need for
    some serious help, I am so frustrated.
    What I want to do is pretty simple, I am building a DJ
    website and the navigation is a pitch controller, similar to what
    they have on a mixing board anyway, when you drag the pitch
    controller I need the movie clip symbol to scroll either up and
    down, so technically the pitch controller will have to start from
    the center, but I have no idea what I am doing.
    I have been going through tutorials for 15 hours but all they
    show you is how to create a normal scroller that starts at the top
    and srolls down. I am in desprite need as I have a deadline to meet
    for tomorrow morning. HELP

    ok this is the code I got from a tutorial that i was woking
    from, but I dont really understand it in detail what I do know is I
    dont need the arror buttons in this code becuase all I need is a
    the scroller.
    scrolling = function () {
    var scrollHeight:Number = scrollTrack._height;
    var contentHeight:Number = contentMain._height;
    var scrollFaceHeight:Number = scrollFace._height;
    var maskHeight:Number = maskedView._height;
    var initPosition:Number = scrollFace._y=scrollTrack._y;
    var initContentPos:Number = contentMain._y;
    var finalContentPos:Number =
    maskHeight-contentHeight+initContentPos;
    var left:Number = scrollTrack._x;
    var top:Number = scrollTrack._y;
    var right:Number = scrollTrack._x;
    var bottom:Number =
    scrollTrack._height-scrollFaceHeight+scrollTrack._y;
    var dy:Number = 0;
    var speed:Number = 10;
    var moveVal:Number =
    (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);
    scrollFace.onPress = function() {
    var currPos:Number = this._y;
    startDrag(this, false, left, top, right, bottom);
    this.onMouseMove = function() {
    dy = Math.abs(initPosition-this._y);
    contentMain._y = Math.round(dy*-1*moveVal+initContentPos);
    scrollFace.onMouseUp = function() {
    stopDrag();
    delete this.onMouseMove;
    btnUp.onPress = function() {
    this.onEnterFrame = function() {
    if (contentMain._y+speed<maskedView._y) {
    if (scrollFace._y<=top) {
    scrollFace._y = top;
    } else {
    scrollFace._y -= speed/moveVal;
    contentMain._y += speed;
    } else {
    scrollFace._y = top;
    contentMain._y = maskedView._y;
    delete this.onEnterFrame;
    btnUp.onDragOut = function() {
    delete this.onEnterFrame;
    btnUp.onRelease = function() {
    delete this.onEnterFrame;
    btnDown.onPress = function() {
    this.onEnterFrame = function() {
    if (contentMain._y-speed>finalContentPos) {
    if (scrollFace._y>=bottom) {
    scrollFace._y = bottom;
    } else {
    scrollFace._y += speed/moveVal;
    contentMain._y -= speed;
    } else {
    scrollFace._y = bottom;
    contentMain._y = finalContentPos;
    delete this.onEnterFrame;
    btnDown.onRelease = function() {
    delete this.onEnterFrame;
    btnDown.onDragOut = function() {
    delete this.onEnterFrame;
    if (contentHeight<maskHeight) {
    scrollFace._visible = false;
    btnUp.enabled = false;
    btnDown.enabled = false;
    } else {
    scrollFace._visible = true;
    btnUp.enabled = true;
    btnDown.enabled = true;
    scrolling();

  • Dragging masked movie clips

    Can anyone point me in the right direction?
    I've been playing around with making a draggable movie clip.
    This movie clip appears within a container, holder_mc, which is
    masked by a mask layer to control what is seen. I can drag
    holder_mc around the screen, but the mask does not move with it.
    When I hit the movie_btn, I cannot see my VideoPlayer.swf file. If
    I do not drag holder_mc anywhere, and just press my movie_btn, I
    cannot drag my swf file. Is there an easy way to have the mask and
    holder_mc drag together, and have drag functionality even after my
    swf is playing?
    Here is what I'm using:
    movie_btn.onRelease = function (){
    holder_mc.loadMovie ("VideoPlayer.swf");
    holder_mc.onPress = function(){
    this.startDrag(false);
    holder_mc.onRelease = function(){
    stopDrag();
    Thanks for any help.

    Couple of ways... simple enter_frame, or enter_frame TweenLite
    addEventListener(Event.ENTER_FRAME, updateReflection, false, 0, true);
    function updateReflection(e:Event):void
         refClip.x = mouseX;
         refClip.y = mouseY;
    or using TweenLite to give it a little softer motion:
    function updateReflection(e:Event):void
        TweenLite.to(refClip, .5, {x:mouseX, y:mouseY});

  • How do you horizontal scroll a movie clip?

    Can anyone suggest any resources for horizontal (left to right) scrolling a movieClip? I want to be able to scroll through a movie clip that has pictures in it. I can't find any good ones that explain the code. FYI, I do not want the user to use a scroll bar to scroll through. They should be able to touch the screen (on the movieClip) and scroll left or right. I looked at the ThrowPops plugin example on Greensock's website but the code is not explained very well.  So I need a basic description of how to scroll a movie clip.

    google: as3 beginner tutorial flash ios movieclip scroll

  • Question about scrolling and Movie Clips Loaded from the Library

    I hope I am posting this in the right forum.
    Ok, I'm using actionscript 2.0, and I am trying to make a scrolling image gallery. I have a movie clip with three layers. the first contains a movie clip used as a scroll bar. The second is a mask used to hide the overflow content, and the third contains movie clip thumbnails. when I click one of the thumbnails, it loads a symbol containing a larger version of the picture over top of the thumbnails on the same layer. My problem is, the large image is added at the very top of the movie clip, even when it is scrolled out of sight. I want it to appear in sight, so the user doesn't have to scroll all the way back up to the top to see it. This is annoying and confusing. Is there a way to do this?
    Here is the code I used to create the scroll effect (there is actually a whole lot more to the code but it is very long, so I am not adding it now. I will if it is needed though) 
    (Oh, and there is no text involved in this. I just got this code off a tutorial and I haven't changed the variable names yet)
        var scrollUpper:Number = 58;
        var scrollLower:Number = 309;
        var textLower:Number = 60;
        var textUpper:Number = -179;
        var scrollRange:Number = scrollLower - scrollUpper;
        var textRange:Number = textLower - textUpper;
        var startY:Number = imagesHolder_mc.thumbs_mc._y;
        function scroll(){
           var moved:Number = imagesHolder_mc.scroller_mc._y - scrollUpper;
           var pctMoved:Number = moved/scrollRange;
           var textMove:Number = pctMoved*textRange;
           imagesHolder_mc.thumbs_mc._y = textLower - textMove;
        imagesHolder_mc.scroller_mc.onPress = function(){
           this.startDrag(false,this._x,scrollUpper,this._x,scrollLower);
           this.onMouseMove = scroll;
        imagesHolder_mc.scroller_mc.onRelease = scroller_mc.onReleaseOutside = function(){
           this.stopDrag();
           this.onMouseMove = null}

    Thanks for your reply. I'll try to explain it better. I have a long, vertically scrolling movie clip. This movie clip contains lots of thumbnails. When I click a thumbnail, the full sized image is loaded from the library and displayed within the same movie clip. when I click the full size movie clip, it disappears again, and I can click another thumbnail to display another full size image. So I'm not just adding more and more stuff to the gallery if that's what you were thinking. I'm just clicking thumbnails to display the full size image so I can look at it, closing it, and moving on.
    But the full sized image is fixed at the very top of the scrolling movie clip, so if I click a thumbnail at the very bottom, I have to scroll all the way back up to the top to see the full size image. I just want the full size image to appear on screen no matter how far down I have scrolled to click a thumbnail.
    I made my basic gallery useing this tutorial:
    http://flashexplained.com/actionscript/making-the-ultimate-dynamic-image-gallery-in-flash- 8/
    if you want to take a look at that, to get an idea of what I'm talking about.
    Now I'm just trying to add some scrolling functionality, which wasn't included, but I don't really understand actionscript well enough to do this easily on my own.
    Sorry for the long reply. I hope this is clearer.

  • Please help! first website! movie clip placed on main timeline wont play!

    Hi! if any one could please help me it would be greatly
    appreciated!
    So im trying to make my first website in flash and ive ran
    into a problem. I have the main movie, my main time line. I have a
    few animations going on in this that were all created in that main
    time line. those work fine. however, i created two new movie clips
    (still inside the same .fla file) and animated them with thier own
    time line. I then thought you could just drag and drop these movie
    clips onto your main time line and they would play inside the
    movie. but when i press ctrl + enter, the dont play!
    here are some points of intrest.
    my main movie (the main time line) is 130 frames.
    the movie clips i made inside the same .fla file are between
    400 and 600 frames.
    i placed both new movie clips on the 130th frame in the time
    line with their own layers.
    also there is a layer for actions on the 130th that has
    stop();
    i thought that maybe the time line had to be as long as those
    movie clips i created and so i extended it but they still didnt
    play.
    im thinking action script is involved? please help me im
    getting pretty frustrated and im sure there is something simple to
    achieve this.
    here is a link where you can download the source files im
    using. if you open the file the two movie clips i created are
    called front two and front one and are layers with the same name.
    this board wont let me fully post my link cause the last word
    in it is s*h*i*t* so youll have to type it in your browser. its
    http://public.me.com/matts*h*i*t*
    (just remove the asterisks)
    also i noticed that my file is huge. i used photoshop to
    create everything and them imported it into flash. is there a way i
    can reduce this size?
    thank you sooo much! please help!
    -Matt

    Hey Matt,
    I'll take a look at your file, but as a general rule, a
    movieclip's timeline plays automatically when it is first
    instantiated. Instatiated means its first frame where "it exists"
    on the timeline that contains it. So the layer that holds your
    movieclip animation, needs to extend the length of the timeline you
    want that movieclip to "exist". Other than that rule, the frames
    don't NEED to match the frames inside said movieclip.
    So, if movieclips play automatically, and yours isn't, there
    must be something either stopping the movieclips timeline, or your
    movieclip isn't existing on the timeline because the layer that
    holds it, doesn't have keyframes the length you need it to.
    Yeah optimizing your sprites (2d graphical elements), and
    using vector when you need to (if you don't know the difference
    between raster and vector, google it) will significantly lower your
    outputted .swf file size.
    Edit: After looking at your file, your movieclips are not
    playing (well, they're technically playing, just not showing up)
    because your masker layer has multiple objects on it. A masker
    layer (not to be confused with the maskee layer, the layer being
    masked) needs to have only one object on it, or else you break the
    mask. The grey border of your mask movieclip needs to be deleted
    before your animation will play.

  • Need help with video-scroll

    Hello,
    I need some help with a project. What I eventually want is that a webcam controls the mouse position and the mouse position
    controls a video. But first I would like the part where the mouse position controls the video.
    So if the mouse is on the left on your screen the video will be at the first frame and when you move you're mouse to
    the right the video will play accordingly to the movement. and stop when the mouse is all the way to the right.
    Effectivly the mouse scrolles through the video. It only needs to be on the x-axis.
    I'm not that formilliar with flash so any help would be great
    Thx!
    Thijs

    I fixed it in an other way.
    Made a imgseq and following code (with some help ):
              stop();
              stage.addEventListener(Event.RESIZE, resizeHandler);
              stage.addEventListener(FullScreenEvent.FULL_SCREEN, resizeHandler);
              stage.addEventListener(MouseEvent.MOUSE_MOVE, inputHandler);
              stage.scaleMode = StageScaleMode.NO_SCALE;
              stage.align = StageAlign.TOP_LEFT;
              var imgSeq:ImgSeq = new ImgSeq();
              var columnWidth;
              var numColumns;
              stage.addChild(imgSeq);
              imgSeq.x = 350
              imgSeq.gotoAndStop(1);
              columnWidth = stage.stageWidth / imgSeq.totalFrames;
              numColumns = stage.stageWidth / columnWidth;
              function resizeHandler(e:Event):void {
              // verdeel het scherm in kolommen, iedere keer dat het scherm geresized wordt.
                        // breedte van 1 kolom (schermbreedte gedeeld door aantal plaatjes)
                        columnWidth = stage.stageWidth / imgSeq.totalFrames;
                        // totaal aantal kolommen dat binnen het scherm past (breedte gedeeld door breedte van één kolom )
                        numColumns = stage.stageWidth / columnWidth;
              function inputHandler(e:MouseEvent):void {
              // voer dit iedere keer dat je de muis beweegt uit.
                        // kijk voor iedere kolom of de muis er binnen valt.
                        for(var i = 1; i <= numColumns; i++){
                                  //vergelijking die checkt of de muispositie binnen de waarden van kolom valt.
                                  if(mouseX <= i * columnWidth && mouseX >= (i * columnWidth) - columnWidth ){
                                            // zet het framenummer van de imageSequence gelijk aan de huidige kolom.
                                            imgSeq.gotoAndStop(i);
    many thx!

  • Help with a scrolling flash panel

    Hello, Ive used the excellent tutorial to create a scrolling thumb panel (http://library.creativecow.net/articles/brimelow_lee/scrolling_thumbnail_panel/video-tutor ial.php)
    It works brilliantly and I have movie thumbs linking to a flash player. It all works fine, what Im needing help with is to change the scrolling.
    At current it scrolls up and down according to where I have set the 'line', I would like it to scroll up and down near the top and the bottom, rather than all the time (effectively creating a dead zone in the middle). I cant figure out how to change the code to get this to behave as required.
    Please Help!
    Below is the code used:
    panel.onRollOver = panelOver;
    function panelOver() {
    this.onEnterFrame = scrollPanel;
    delete this.onRollOver;
    var b = stroke.getBounds(_root);
    function scrollPanel() {
    if(_ymouseb.yMax || _xmouseb.xMax) {
    this.onRollOver = panelOver;
    delete this.onEnterFrame;
    if(panel._y >= 278) {   //FIRST BUTTON 'Y' POSITION
    panel._y = 278;
    if(panel._y <= -177) { //CHANGE '229' TO THE 'Y' POSITION OF THE LAST BUTTON IN THE 'PANEL' MOVIE, POSITIONED VISIBLE WITHIN THE BOARDERS.
    panel._y = -177;
    var ydist = _ymouse - 251; //POSITION ON STAGE OF UP/DOWN SCROLLING 'LINE'
    panel._y += -ydist / 150;   //SPEED OF SCROLLING (LOWER = HIGHER)

    use:
    panel.onRollOver = panelOver;
    function panelOver() {
    this.onEnterFrame = scrollPanel;
    delete this.onRollOver;
    var b = stroke.getBounds(_root);
    function scrollPanel() {
    if(_ymouseb.yMax || _xmouseb.xMax) {
    this.onRollOver = panelOver;
    delete this.onEnterFrame;
    if(panel._y >= 278) {   //FIRST BUTTON 'Y' POSITION
    panel._y = 278;
    if(panel._y <= -177) { //CHANGE '229' TO THE 'Y' POSITION OF THE LAST BUTTON IN THE 'PANEL' MOVIE, POSITIONED VISIBLE WITHIN THE BOARDERS.
    panel._y = -177;
    var ydist = _ymouse - 251; //POSITION ON STAGE OF UP/DOWN SCROLLING 'LINE'
    if(_ymouse>lowerY || _ymouse<upperY){
    if((_ymouse>lowerY){
    ydist=_ymouse-lowerY;  // define lowerY
    } else {
    ydist=_ymouse-upperY;  // define upperY
    } else {
    ydist=0;
    panel._y += -ydist / 150;   //SPEED OF SCROLLING (LOWER = HIGHER)

  • Hi, i am a bit of a newbie at AS & need some help applying it to a movie clip button

    I have created a movie clip button but am stuck with the actionscript. I have created the rollover and rollout for this movie clip button but i want it to do 2 things after this i want it to go and stop on the first frame of a movieclip which has my content on it called portfoliogallery_mc (which is also the same instance name for it) when you then click the button i want it to go and play frame 11 of that movie clip portfolio gallery_mc.
    Here is my current actionscript i HAVE Flash 8 on my comp that i am currently using.
    Please note my actions are on a layer called actions and not on the movieclip button itself.
    nxtimagetwo_mc (is the movie clip button/instance of mc)
    THE CODE I HAVE USED
    this.nxtimagetwo_mc.onRollOver = function() {
    nxtimagetwo_mc.gotoAndPlay("_over");
    this.nxtimagetwo_mc.onRollOut = function() {
    nxtimagetwo_mc.gotoAndPlay("_out");
    portfoliogallery_mc.gotoAndStop(1);
    portfoliogallery_mc.gotoAndPlay(11);
    currently it is playing to frame 11 not stopping at frame 1 and stops on frame 20 where i have a stop action. I also have a stop action on frame 1 of that movie clip.
    What I want it to do is first stop at frame 1 of that movie clip and when the button is clicked again to go and play frame 11 of that same movie clip.
    Basically what i want the mc button to do is 2 things automatically stop the mc for the first content and when button is clicked let the content fad out and play to where the next stop action is set to in the Movie Clip.
    Nothing to with the above www.rsquareme.co.uk is my current portfolio website if you would like to check it out it is not fully complete yet.

    it doens't make sense to execute:
    portfoliogallery_mc.gotoAndStop(1);
    portfoliogallery_mc.gotoAndPlay(11);
    only the 2nd line of code will be effected.
    i know you want to control 2 movieclips.  what are the instance names of the two movieclips and what do you want to occur in each of those movieclips.
    or, do you want to control 1 movieclip and have it play a certain sequence of frames followed by another sequence of frames?

  • Need help with AS3 to play movies

    Here is my what I'm working with: Flash CS3, AS3. I have 4
    buttons and 4 movies (each button will be asigned to play one of
    the 4 movies).
    Not sure if this is the best layout but here is what's
    included in my file. I have an Actions layer, 4 buttons (on 4
    different layers), 4 embedded movies (on 4 different layers...all
    about 5-8 seconds long). I'm sure this is simple but figuring out
    the code for AS3 is like learning Chinese....I need major help with
    this.
    Lets say that my buttons have instance names like button1,
    button2, button3, button4, and my movies have instance names like
    movie1, movie2, movie3 and movie4. Here's the catch. I don't want
    the movies viewable (or seen) until the user selects one of the
    buttons. So if the user selects button1 the movie will appear (next
    to the button without any contols...just a movie with a border) and
    play. If the user hovers off or moves the mouse off the button, I'd
    like for the movie to disappear.
    Can someone please give me the the code needed so that when I
    select button1 that it will play movie1, button2 w/ movie2....and
    so on.
    Thanks for your help!

    Here is the link to the fla file.
    http://joshhicks.com/flash/flashfile.html
    I updated the link to the latest swf
    http://joshhicks.com/flash/del2.html
    I added stop(); to the 1st frame of each moive and this fixed
    the movies from playing in the background unseen. If you can help
    me with one last question...then the file will be complete. As of
    now when you select one of the movies, it plays once thru and
    starts back at frame one (loops) which is the way I want it to
    play. But if you hover off one of the buttons while the movie plays
    (lets say when the movie is showing the number 2) when you go back
    to view the same movie, it will start where you left off (it will
    start on the fram showing 2 and not 1). How can this be set up to
    play from the beginning of each movie everytime you happen to go
    back and click on the button? Thanks

  • Problems with button inside draggable movie clip

    I am building a click through presentation that has some small text in it. To maintain the design and allow for readability, I have added a zoom feature.
    Here is the structure of the movie,
    Stage - contains pages movie clip and forward/reverse click buttons for changing pages
         pages_mc - contains 24 frames, one page per frame and buttons
    There is a button at the _root level that uses a tweener to scale the pages_mc up to 170%. When this is clicked, it allows the pages to be dragged around the screen so you can look at different sections. When you click the button again, it returns the pages back to their original size stops drag.
    My problem is, on the pages, there are buttons with links to external sites. Once startDrag has been invoked, I cannot touch the buttons inside the movie clip. Is there a way to make these buttons work?
    I need the finished quickly so any assistance is welcome.
    Code below
    magUp_btn.onRelease = function() {
    this._visible = false;
    TweenLite.to(pages_mc, .25, {_x:-250, _y:-193, _xscale:170, _yscale:170});
    TweenLite.to(magUp_mc, .75, {_alpha:0});
    TweenLite.to(magDown_mc, .75, {_alpha:25});
    magDown_btn._visible = true;
    pages_mc.onPress = function(){
    this.startDrag();
    pages_mc.onRelease = function(){
    this.stopDrag();
    pages_mc.onReleaseOutside = function(){
    this.stopDrag();
    pages_mc.useHandCursor = false;
    TweenLite.to(instr_mc, 1, {_alpha:100});
    magDown_btn.onRelease = function() {
    TweenLite.to(pages_mc, .25, {_x:0, _y:0, _xscale:100, _yscale:100});
    TweenLite.to(magUp_mc, .75, {_alpha:25});
    TweenLite.to(magDown_mc, .75, {_alpha:0});
    this._visible = false;
    magUp_btn._visible = true;
    pages_mc.onPress = function(){
    this.stopDrag();
    TweenLite.to(instr_mc, 1, {_alpha:0});
    I don't know how to turn drag off when I zoom out without using the onPress command, but I know that this is probably what is getting in the way of the button working?
    Thanks!

    One option is to make the background of the pages be the draggable parts rather than the movieclips that contain the pages and buttons.  That way, the buttons could be atop the background and not have their access blocked.
    Instead of coding the pages_mc, you would essentially have the background coded for the drag...
    pages_mc.bkgnd.onPress = function(){
        startDrag(this._parent);

  • Problem with accessing dynamically created movie clips, returns null...

    Hopefully this is a stupid question with an easy answer, if my code is straight forward enough.
    I am using this snippet of code to create menu items, and then use the jCount variable below to give the clips an index number, like so (which seems to be working just fine):
    for(var j:Number=0;j<xmlSubMenuLength;j++){ 
        var mcSubMenuItem:mcSubMenu=new mcSubMenu();   
        addChild(mcSubMenuItem);    
        jCount++;   
        mcSubMenuItem.name = "mcSubMenuItem" + jCount;
        //traces out names correctly
        trace ("---------------------------------jCount NAME = "+ mcSubMenuItem.name);
        mcSubMenuItem.x=mcMenuHolder.x+20;
        mcSubMenuItem.y =mcMenuHolder.y;
        mcSubMenuItem.y+= nextBtnY;
        nextBtnY+=subtopicSpace;
        global_subi.text = String(jCount); //i see the proper count of 10 in the text field
    However, when I try to access the clips using this snippet:  
    for(var j:Number=0;j<Number(global_subi.text);j++)//
      trace("GLOBAL SUBI = "+ String(global_subi.text));  //traces out 10, which it should
      var scSubMenuItem:String = "mcSubMenuItem" + j;  
      var scSubContent:Object = this.getChildByName(scSubMenuItem);
      trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scSubContent:Object = "+ scSubContent); //returns null!
    My last trace statement returns null. Can anyone see my error, or explain why I can't access my clips after they have been created?
    Thank you muchly,
    ~Chipleh

    Hi kglad,
    Thanks for the response.
    "it's not clear from the shown code that jCount is initialized." - I've posted the relevant code below, which shows that I'm initializing jCount.
    "and it's not clear why you don't use j instead of jCount in that for-loop" - j is used as loop for creating the subtopic movie clips within the i for-loop. So, for each topic in i for-loop, create a group of suptopics using the j for-loop. The j for-loop re-initiates j every time the length of the subtopics is reached(if that makes any sense) - i.e. topic1>subtopic 1,2,3,4 : topic2>subtopic>1,2 : topic3>subtopic1,2,3,4
    jCount is used to keep a running count of the total number of subtopcs created - i.e. per the example above, jCount will display 10.
    var topicSpace:uint=button_mc.height;
    var subtopicSpace:uint = button_mc.height;
    var nextBtnY:uint = 0;//whatever;
    var jCount:Number = 0;
    function createXMLMenu(menuLength:Number,itemName:XMLList):void{
         var navItemText:XMLList = itemName;
          for(var i:Number=0;i<menuLength;i++)
               var mcMenuItem:mcMenu=new mcMenu();        
               addChild(mcMenuItem); 
               mcMenuItem.btnTxt.htmlText = i+1 +". " +navItemText[i];  
               mcMenuItem.ivar = i;  
               mcMenuItem.name = "mcMenuItem" + i;  
               mcMenuItem.x=mcMenuHolder.x;
               mcMenuItem.y =mcMenuHolder.y;
              //kglad's addition
               mcMenuItem.y+= nextBtnY;
               nextBtnY+=topicSpace; 
               var subVar:Number = i;//mcMenuItem.ivar 
               //Submenu content
               var xmlSubMenuLength:Number = xml.sim.bodyText.page[i].subpage.length()
               var menuItemAttachment:MovieClip = MovieClip(mcMenuItem); 
               for(var j:Number=0;j<xmlSubMenuLength;j++)
                     var xmlSubPageNumber:XMLList = xml.sim.bodyText.page[subVar].subpage;
                     var subNavLinkNumber:Number = xmlSubPageNumber[j];
                     var subTitleText:String = xml.sim.bodyText.page[subVar].subpage.subNavItem[j];
                     var mcSubMenuItem:mcSubMenu=new mcSubMenu();
                     trace("mcSubMenuItem.ivar = "+ j+1);
                     var mc2Attach2:MovieClip = MovieClip(menuItemAttachment);
                     mcSubMenuItem.btnTxt.htmlText = j+1 +". " +subTitleText;   
                     mcSubMenuItem.ivar = Number(subVar);
                     mcSubMenuItem.jvar = Number(j);
                     addChild(mcSubMenuItem);
                     jCount++;   
                     mcSubMenuItem.name = "mcSubMenuItem" + jCount;
                     trace ("---------------------------------jCount NAME = "+ mcSubMenuItem.name);
                     mcSubMenuItem.x=mcMenuHolder.x+20;
                     mcSubMenuItem.y =mcMenuHolder.y;
                     //kglad's addition
                     mcSubMenuItem.y+= nextBtnY;
                     nextBtnY+=subtopicSpace;    
                     global_subi.text = String(jCount);
                mcSubMenuItem.lExtend.visible = false;  
    global_i.text = String(i);
    Then I try to access the clips like so:
    -The first for-loop access the topic movie clips, no problem, and traces out scContent correctly.
    -The second for-loop traces out null everytime, when I would expect it to be tracing out the names of the subtopic movie clips.
    function accessClips(){
         //This will access the topic movie clips
         for(var i:Number=0;i<Number(global_i.text);i++)
               var scMenuItem:String = "mcMenuItem" + i;
               var scContent:Object = this.getChildByName(scMenuItem);            
               trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scContent:Object = "+ scContent);
         //This is supposed to access the subtopic movie clips
         for(var j:Number=0;j<Number(global_subi.text);j++)//
               var scSubMenuItem:String = "mcSubMenuItem" + j;
               var scSubContent:Object = this.getChildByName(scSubMenuItem);
               trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scSubContent:Object = "+ scSubContent);
    Hope this makes sense, Chipleh confused. If the code is not clear enough, let me know and I'll try to further clarify.
    Thanks again,
    ~Chipleh

  • Mask - movie clip loaded from .swf

    Hi!
    I have made an application where a movie clip (map_mc) is
    masked by another movie_clip (map_window_mc:
    map_mc.setMask("map_window_mc");
    This works fine until I try to load an "external" .swf into
    map_mc:
    map_mc.loadMovie("Testmap.swf");
    Then the mask does not work anymore......
    Any suggestions?
    (The testmap.swf is also displaced from map_mc.........)
    I use Flash 2004 MX pro
    terjem

    terjem,
    > My problem is probably that I really don't know wath
    event
    > handler I should use...
    Depending on the approach you're using, there may not even
    be an event
    handler when the external SWF loads. If you're using the
    MovieClipLoader
    class, there will be. If you're using a
    MovieClip.onEnterFrame loop, there
    won't be.
    > Here is the first ("non-automatic") code that works:
    Okay.
    > map_mc.loadMovie("Testmap.swf");
    > trace("Loading started!");
    > this.onEnterFrame = function() {
    > if (
    > map_mc.getBytesLoaded() > 0 &&
    > map_mc.getBytesLoaded() >= map_mc.getBytesTotal()
    > ) {
    > trace("Loading complete!");
    > trace("File width: " + map_mc._width);
    > delete this.onEnterFrame;
    > } else {
    > trace("File width: " + map_mc._width);
    > }
    > };
    Okay. So far, so good. When bytes loaded is greater than
    zero and
    greater than or equal to bytes total, you'll know the
    external SWF has fully
    loaded. You'll know, because the "Loading complete!" trace
    will be visible
    in your Output panel. Well, that means the place in this
    script that
    represents "where to put additional code" is right were your
    trace()
    functions are. Not in the "else" clause, but the first one
    this.onEnterFrame = function() {
    if (
    map_mc.getBytesLoaded() > 0 &&
    map_mc.getBytesLoaded() >= map_mc.getBytesTotal()
    trace("Loading complete!");
    trace("File width: " + map_mc._width);
    [delete these trace() functions, if you like]
    [add your masking code here]
    delete this.onEnterFrame;
    // etc.
    > The code below does not work (the positioning of the
    > map_mc works, but not the setMask):
    Your problem may be right here ...
    > map_mc.setMask("map_window_mc");
    ... because "map_window_mc" is in quotes. Yes, the
    ActionScript Language
    Reference says the parameter of setMask() may be a string,
    but leave the
    quotes out and see what happens. In any case,
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Need help with my scroll for curve 9300

    hi my phone is being veery weird today wellthis morning my phone was working perfectly fine then all of a sudden the scroller decides to scroll up when i try to scroll down or it moves where ever it likes and i dont know why it does this, i have tried turning my phone off and it didnt stop it and now i dont know what to do so if you can help me sort this problem then please tell me cos i havnt had this phone long and i hope i dont have to send it off for repares please help! thanks

    Hi and Welcome to the Community!
    Anytime random strange behavior or sluggishness creeps in, the first thing to do is a battery pop reboot. With power ON, remove the back cover and pull out the battery. Wait about a minute then replace the battery and cover. Power up and wait patiently through the long reboot -- ~5 minutes. See if things have returned to good operation. Like all computing devices, BB's suffer from memory leaks and such...with a hard reboot being the best cure.
    Best!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

Maybe you are looking for

  • No Cartoon Network HD?

    I just switched to FIOS from cable and there is no Cartoon Network HD (mainly for Star Wars Clone Wars), not to mention the lack of BBC America HD. I would gladly trade about 100 of the other useless channels to get these two. Please, Verizon, take a

  • IBook won't load Firewire drive; "unknown device"

    That's the summation via System Profiler. It's a SmartDisk Firelite enclosure but I swapped the old 40 GB drive that failed for a new Seagate Momentus 80 GB drive. My G4 dualie recognizes the new SmartDisk setup fine. It loads immediately and I was a

  • Differences in the message id between IMAPMessage and MimeMessage

    Hi, When I'm getting IMAPMessage from the IMAP server and calling getMessageID() I got next id (for the privacy reasons it not real, but reproduce the differences) : <[email protected]> Then, when I saved this message to the disk and read it as MimeM

  • I have a problem installing adobe flash player on my macbook

    can anyone please help me , i cant load Flash Player on my macbook , i am runing OS X Yosemite  10.10.2 when i try and load the program a sign comes up siging that it will only run for a few seconds and i only mange to download 30% and it then stops

  • Software Inventory - MDM

    is it possible that Intune's software inventory collections information only from Windows 7\8 devices and not from mobile devices?! I have both iOS and Android devices enrolled to my tenant. when I try to generate a software report on the mobile devi