Dec 03 2007

Flash CS3, UIScrollBar, scroll arrows not displaying on dynamic text

Tag: FlashTyrone @ 10:01 pm

I am currently working on a Flash CS project and I recently came across an issue with using the UIScrollBar component..  The issue was quite intermittent; but after attaching the scroll bar component to dynamic the text box I was expecting to see bars and the arrows when the contents within the text box were larger than the constraints defined for the text box. After running the project both within the browser and in the SWF player, I noticed that on some occasions the scrolling was active and on some, inactive. 

After a few hours of research, I still couldn’t find a resolution to this issue. Then, I turned to the Flash CS3 documentation and after some careful reading of the UIScrollBar component documentation, I found the answer. The documentation mentioned that if you are dynamically loading text from an external source from ActionScript and then assigning that text to the dynamic text box, you must call the update() method on the scroll bar component to alert it that the contents have changed. So, if you have an instance of a dynamic text box on the stage called mytext_txt, and you attach a UIScrollBar component to the box by dragging the component on top of it.  You then must assign a instance name to the scroll bar component so that you can reference it within ActionScript.  Let’s say I name it mytext_scroll. Here is what the ActionScript 3 would look like:

 

   1:  import flash.display.*;
   2:  import flash.events.*;
   3:   
   4:  var textLoader:URLLoader = new URLLoader();
   5:  var simpleReq:URLRequest = new URLRequest("mytext.txt");
   6:   
   7:  textLoader.load(simpleReq);
   8:  textLoader.addEventListener(Event.COMPLETE, textComplete);
   9:   
  10:  function textComplete(event:Event):void {
  11:      mytext_txt.text = textLoader.data;
  12:      mytext_scroll.update();
  13:  }

 

Notice the update() on line 12. This seem to do the trick for me.  Hopefully, I was able to help someone figure this issue out. Until next time…

Happy Coding!


Nov 21 2007

VS 2008 - "Visual Studio encountered an unexpected error"

Tag: Visual StudioTyrone @ 8:23 am

Now that VS 2008 has been released to MSDN Subscribers, I went ahead like everyone else to rush to download and install it.  Not to my surprise, the install went perfectly since I didn’t install any pre-release version on my machine. I leaned my lesson last time when VS 2005 was released and all the headaches I had then. However, once installed, I was unable to use VS 2008 because it kept crashing and providing me with an error of "Visual Studio encountered an unexpected error"  when trying to interact with any part of the user interface. I couldn’t even exit from the program. I had to keep killing the process.  I’m like great, your not the only one who this error caught unexpectedly.  So, I figured a reboot would take care of it since I didn’t bother to reboot after the install. Nope, didn’t work.  I did a repair. Didn’t work. So, I did a complete uninstall, then reinstall and still didn’t work.  So, at this point I am frustrated since about 2 or 3 hrs have already passed.

I then decided to do some debugging…yes debugging…and I decided to start Visual Studio in Safe mode. You can do that by choosing:

Start, Run and enter this command     devenv /SafeMode

OR

Execute the same command from the command prompt directly.

After doing this, Visual Studio worked fine. I could use the menus, bring up dialog boxes, etc.  So, I believe that running is SafeMode doesn’t load any add-ins or custom VSIP packages, and I suspected one of these were probably causing the issue.  I was right, I use VisualSVN for accessing my Subversion source control repositories through Visual Studio. Its a great tool and even thought it $50, I find it very useful and much better than anything I could get for free.

So, I uninstall VisualSVN, version 1.2.4 (I think), and started VS 2008 and everything worked perfectly.  I then proceed to the VisualSVN web site to download the latest version, installed, and the new version and VS 2008 worked nicely.

I hope this helped somebody even if you don’t use VisualSVN, there may be some other add-in that may cause similar issues with VS 2008. Until next time…

Happy Coding!

 

 

kick it on DotNetKicks.com


Nov 16 2007

.NET and the Provider Model

Tag: .NET Framework, ASP.NETTyrone @ 11:42 pm

If you have been using the new features of the ASP.NET 2.0 web framework like Membership, Roles, SiteMap, Profiles and others, you have probably heard about the Provider Model. If not, have no fear, you have been using it all along.  The Provider Model is a set of API’s that were build into the .NET 2.0 Framework that gives both windows and web developers the ability to build applications that allow certain features/functionality to be replaced, at runtime, via the application’s configuration file.  The only requirement is that the new feature must implement all of the interfaces of the feature being replaced.  This is all done through a set of abstract classes.

Without going through much detail, Miguel Castro was a guest on DnrTV and he really goes into detail on a real word example ( Credit Card Processing ) on how you would use the Provider Model for this senario.  This was a really great show and it’s the real reason why I was encouraged to blog about this.

Happy Coding!

 

 

kick it on DotNetKicks.com


Nov 14 2007

Hello Developers!

Tag: UncategorizedTyrone @ 1:38 pm

This is my first post and I thought I should use it for testing purposes. My plans on starting this blog is to use this as a means of documenting — yes, I said it — my journey as a full-time developer.  The older I get, the more I forget things that I may have done years or even months ago. So, whatever I come across and I feel it’s worth a blog post, I will certainally do that. Until next time.

Happy coding!

Tyrone


« Previous Page