Dynamic Textfield Not Clickable

  • oreth
  • Born
  • Born
  • No Avatar
  • Joined: Aug 27, 2008
  • Posts: 3
  • Status: Offline

Post August 27th, 2008, 9:52 am

ok... so I've got a movie clip that creates a square, then plops two text fields into it. One being the title, the other being HTML that contains a link.

Code: [ Select ]
//create movie clip
_root.createEmptyMovieClip("menu_mc",1);


//draw rectangle
menu_mc.lineStyle(2,0xFFFFFF);
menu_mc.beginFill(0x000000,75)
menu_mc.moveTo(0,0);
menu_mc.lineTo(0,300);
menu_mc.lineTo(300,300);
menu_mc.lineTo(300,0);
menu_mc.lineTo(0,0);

//move under mouse
menu_mc._x = _root._xmouse-100;
menu_mc._y = _root._ymouse-50;
menu_mc._alpha = 100;
    
//create menu title
menu_mc.createTextField("menuTitle",getNextHighestDepth(),10,10,280,30);
menu_mc.menuTitle.text = "Menu";

//create contents
menu_mc.createTextField("menuContents",getNextHighestDepth(),0,50,280,100);
menu_mc.menuContents.html = true;
menu_mc.menuContents.selectable = true;
menu_mc.menuContents.htmlText = '<a href="http://www.google.com">Click Me<a/>';
  1. //create movie clip
  2. _root.createEmptyMovieClip("menu_mc",1);
  3. //draw rectangle
  4. menu_mc.lineStyle(2,0xFFFFFF);
  5. menu_mc.beginFill(0x000000,75)
  6. menu_mc.moveTo(0,0);
  7. menu_mc.lineTo(0,300);
  8. menu_mc.lineTo(300,300);
  9. menu_mc.lineTo(300,0);
  10. menu_mc.lineTo(0,0);
  11. //move under mouse
  12. menu_mc._x = _root._xmouse-100;
  13. menu_mc._y = _root._ymouse-50;
  14. menu_mc._alpha = 100;
  15.     
  16. //create menu title
  17. menu_mc.createTextField("menuTitle",getNextHighestDepth(),10,10,280,30);
  18. menu_mc.menuTitle.text = "Menu";
  19. //create contents
  20. menu_mc.createTextField("menuContents",getNextHighestDepth(),0,50,280,100);
  21. menu_mc.menuContents.html = true;
  22. menu_mc.menuContents.selectable = true;
  23. menu_mc.menuContents.htmlText = '<a href="http://www.google.com">Click Me<a/>';


This works just fine...

but when I add:
Code: [ Select ]
    menu_mc.onRollOut = function()
    {
        menu_mc.unloadMovie();
    }
  1.     menu_mc.onRollOut = function()
  2.     {
  3.         menu_mc.unloadMovie();
  4.     }


I'm no longer able to click the textfield... any suggestions?
Any ideas?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 27th, 2008, 9:52 am

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post August 27th, 2008, 11:51 am

I would assume whatever content you "unload" is defining a hit area in your clip. Instead, make a completely transparent movieclip inside your menu_mc and call your button actions on that...

Code: [ Select ]
menu_mc.menuBG_mc.onRollOut = function(){
this._parent.loadedMovieHolder_mc.unloadMovie();
}
  1. menu_mc.menuBG_mc.onRollOut = function(){
  2. this._parent.loadedMovieHolder_mc.unloadMovie();
  3. }


Basically your killing the button by unloading the clips content.
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • oreth
  • Born
  • Born
  • No Avatar
  • Joined: Aug 27, 2008
  • Posts: 3
  • Status: Offline

Post August 27th, 2008, 12:33 pm

Excellent, thank you.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 54 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.