# Flash function loading problem

**URL:** <https://forum.kirupa.com/t/flash-function-loading-problem/324283>\
**Category:** Uncategorized\
**Created:** [August 12, 2011, 8:57am UTC](https://forum.kirupa.com/t/flash-function-loading-problem/324283 "2011-08-12T08:57:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wouter11](https://avatars.discourse-cdn.com/v4/letter/w/59ef9b/32.png) [@wouter11](https://forum.kirupa.com/u/wouter11)\
**Post date:** [August 12, 2011, 8:57am UTC](https://forum.kirupa.com/t/flash-function-loading-problem/324283/1 "2011-08-12T08:57:32Z")

</div>

Hi all,

Im working on my own flash website and I’m a kind of newbie and at the moment I have a very weird problem. There are completely no errors involved but it isn’t working. well here is my code.

```auto

public function homescreenbuttons(){
            hsbuttonloader.addEventListener(Event.COMPLETE, buttonloadComplete);
            hsbuttonloader.load(new URLRequest("lockbutton.xml"));

            function buttonloadComplete(e:Event):void {
                xmlData=new XML(e.target.data);
                xmlList=xmlData.IMAGE;
                loadlockImage();
            }//end of function buttonloadComplete(e:Event):void {
            
            function loadlockImage():void {
                    //trace("mp3 button nummer = " + i);
                    lockbutton = new Loader();
                    lockbutton.load(new URLRequest(xmlData.IMAGE.@LOCK));
                    trace("URL mp3 button = " + xmlData.IMAGE.@LOCK);
                    lockbutton.x = 1100;
                    lockbutton.y = 850;
                    bg.addChild(lockbutton)
                    lockbutton.addEventListener(MouseEvent.CLICK, unlock);
                    
            }//end of function loadlockImage():void {
            
            function unlock(event:Event):void{
                trace ("Tween Homescreen");
                TweenLite.to(time, 3, {x:0, y:-700});
                TweenLite.to(datefinal, 3, {x:0, y:-600});
                TweenLite.to(homescreentext, 3, {x:0, y:-700});
                
                time.addEventListener(Event.COMPLETE, tweenfinished);
                
                function tweenfinished(event:Event):void{
                    trace ("tweenfinished");
                    dragbg();
                    Textfields();
                }//end of function tweenfinished(event:Event):void{
                
            }//end of function unlock(event:Event):void{
                        
        }//end of public function homescreenbuttons(){

```

Well the problem is, i tween some objects but when the object time is finished tweening it should start the function tweenfinished. But i don’t get the message tweenfinished in the output.

Does anyone knows where the problem is?

Thanks in advance,

Wouter
