views:

219

answers:

2

Ok I have a TabNavigator component that keeps added a hash (#) to the URL. I need to prevent this. I have it set to historyManagementEnabled="false" but it is still adding the # to the URL when it initializes.

The reason why adding this hash is such a problem is because, I am using .htaccess to give my URL a pretty URL like domain.com/designer/category/product/id when the page is really located at domain.com/product.php?pid=id So in order for my assets to load correctly I had to add a base tag like this:

<base href="http://www.MYDOMAIN.com/" />

But since I have this base tag set, whenever my flex app adds the # to the URL, the page is now automatically redirected to the homepage.

So I really need to figure out a way to stop the TabNavigator from adding the # to the URL.

Any ideas?

Thanks!!

+1  A: 

Turn off the history management in your Flex Builder project settings (in the Flex Compiler settings).

James Ward
A: 

I was able to fix it by extending the TabNavigator and overriding these functions:

package
{
    import mx.containers.TabNavigator;

    public class MyTabNav extends TabNavigator
    {
     public function MyTabNav()
     {
      super();
     }

     override public function get historyManagementEnabled():Boolean
     {
      return false;
     }

     override public function set historyManagementEnabled(value:Boolean):void
     {
      return;
     }
    }
}
John Isaacks