Sep 01 2011

Making Stagevideo backwards compatible.

Published by under AS 3.0,Flash

In my earlier blog post i mentioned how the user needs Flash Player 10.2 for Stagevideo to work but if you want to make sure that your video player is compatible with older versions of Flash some changes need to be done.

The trick to achieve this is not to use any stagevideo classes and make them generic and we need to add a timer to check if the stagevideo event is fired or not. To demonstrate this i am going to use the sample code presented in this article and make same code compatible with 10.1 and older versions of the Flash Player.

If you look at the code the classes which cause problem are stagevideo specific classes i.e. flash.media.StageVideo or flash.events.StageVideoAvailability etc, these are not present in 10.1 and older so we have to get rid of those.

Some tricks that i have used is to remove the event classes and reference the individual events with strings. for eg.

1
container.stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState);

is replaced by,

1
container.stage.addEventListener("stageVideoAvailability", onStageVideoState);

this shouldn’t change in future releases if flash hopefully but if it does then you have to change your code unfortunately.

One additional thing to note is that the above event won’t get fired in 10.1 and older flash versions so we add a 1 second timer to detect if this event is fired or not. This allows us to fall back on using regular video to play our media file.

The modified class and the original class which are included in the flex project can be downloaded here for comparison.

One response so far

Aug 29 2011

Stage Video Problems

Published by under AS 3.0,Flash

Adobe announced Flash Player 10.2 a while back and the main update was StageVideo which allows rendering of video using the hardware and in a completely different way. This article really explains that in detail on how the amazing better CPU performance is achieved and other limitations.

This blog post i want to highlight the problems in using stagevideo which i personally have come across and hopefully adobe will resolve soon.

  • No Flex Support. If you take class containing stagevideo and add to an instance of UIComponent the video doesn’t render. All you see is a blank screen, you can tell the video is playing because you can hear it.
  • you have to use wmode=”direct” in your html embed otherwise it doesn’t work, this usually is not a problem but sometimes can be. If you have some over laying content like a menubar it will show behind the flash, our company website www.eonline.com has this problem and we don’t use stagevideo for our live streaming events even though the player is capable.
  • No Backward Compatibility, if you use the stagevideo classes then the user needs to have 10.2 installed, Flash player will throw an exception otherwise. I have created a hack to use stagevideo and make it backwards compatible but its not out of the box. blog post about it

These are not major problems but Flex support is a huge one i believe. Hopefully we will see support for it soon but it seems like the Flex team is focussed on mobile platform for now.

Other restrictions on stage video are noted in the article linked above.

No responses yet

Feb 03 2011

Creating Bottom Navigation Bar Flex Mobile Part 2

Published by under Flex,Mobile

In my earlier post i wrote about a way how you can create a bottom navigation bar in your Flex mobile applications. But recently i came across TabbedMobileApplication which has a Tabbar component built in but the tabbar is on top.

It was fairly easy for me to modify the skin for this application’s TabbedViewNavigator component so that it would have the tabbar in bottom and the viewnavigator on top.

This is how the application looks,



I just copied the skin file from TabbedViewNavigatorSkin and modified it little to achieve the result.

This is how my custom skin class looks as below, you can download the project file here.

package skins {
    import spark.components.ButtonBar;
    import spark.components.Group;
    import spark.skins.mobile.TabbedViewNavigatorSkin;
    import spark.skins.spark.ButtonBarSkin;
   
    public class MySkin extends TabbedViewNavigatorSkin {
       
        public function MySkin() {
            super();
        }
       
       
        protected override function createChildren():void{
            contentGroup = new Group();
            contentGroup.id = "contentGroup";
           
            tabBar = new ButtonBar();
            tabBar.id = "tabBar";
            tabBar.requireSelection = true;
            tabBar.setStyle("skinClass", ButtonBarSkin);
            tabBar.height = 40;
            addChild(tabBar);
            addChild(contentGroup);
           
        }
       
        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
        {
            super.updateDisplayList(unscaledWidth, unscaledHeight);
           
            var tabBarHeight:Number = 0;
           
            if (tabBar.includeInLayout)
            {
                tabBarHeight = Math.min(tabBar.getPreferredBoundsHeight(), unscaledHeight);
                tabBar.setLayoutBoundsSize(unscaledWidth, tabBarHeight);
               
                tabBarHeight = tabBar.getLayoutBoundsHeight();
            }
           
            if (currentState == "portraitAndOverlay" || currentState == "landscapeAndOverlay")
            {
                tabBar.alpha = .6;
               
                if (contentGroup.includeInLayout)
                {
                    contentGroup.setLayoutBoundsSize(unscaledWidth, unscaledHeight);
                    contentGroup.setLayoutBoundsPosition(0, 0);
                }
            }
            else
            {
                tabBar.alpha = 1.0;
               
                if (contentGroup.includeInLayout)
                {
                    var contentGroupHeight:Number = Math.max(unscaledHeight - tabBarHeight, 0);
                   
                    contentGroup.setLayoutBoundsSize(unscaledWidth, contentGroupHeight);
                    contentGroup.setLayoutBoundsPosition(0, 0);
                }
                if (tabBar.includeInLayout){
                    tabBar.setLayoutBoundsPosition(0, contentGroupHeight);
                }
            }
        }
       
    }
}

4 responses so far

Jan 12 2011

Season Long Ski School

Published by under Skiing

Last year was my first year skiing seriously, 22 days, out of which 17 were at Mammoth. My first weekend at Mammoth i was doing only chair 11, bunny slope, and by my last day of season i was able to ski cornice and scotty’s, single black runs, when groomed.

I was definitely happy with my progress but i wanted to get better and more importantly ski those runs with the right technique. The best way to do that was to take the Season Long Ski Program at Mammoth and in this blog post i am going to describe my personal experience as i go through this program.

Week 1: First Day.
Week 2: Learning to be patient.
Week 3: Frustrating day of back and forth.
Week 4: Being more patient
Week 5: Rotary Skills
Week 6: Back to Basics
Week 7: Confidence in Trees
Week 8: Adhering to Basics

Week 1:

We all met at the ski school in main lodge at around 9.30 and as expected the first day would involve making groups according to everyone’s of skiing abilities/goals. To my surprise there were quite a few folks who had taken this last year and were returning this year.

I joined the group which could ski cornice, scotty’s when groomed and initially we were 5 in the group. One local and rest from LA area. We did first run on broadway and then 3 runs off chair 3. One of them the face, a bumps run west bowl and one from the back side, saddle bowl. At this point we got split into more groups and i was put together with two ladies.

On Saturday, One of the guys i was skiing with commented that i was initiating a new turn without completing my previous turn. It was immediately caught by my instructor and gave me some tips on how to improve on that. He also asked us to use our hands and poles more.

We did stump alley few more times and every time the focus was on to make those turns properly. Our Instructor asked us to apply pressure on toe to initiate the turns along with the hands and poles. I focussed on the same and could easily tell that it was all about applying and releasing the pressure.

He also gave us a lot of additional information about how skiing is mainly about 4 main things and synchronization of all the elements. Since my Elan 999 are not exactly carving skis, making short turns on my skis was going to be a problem so for the next week i would be bringing my atomics beta carves to test out the new things that i learned.

Other important suggestion was that to observe the skiers on the slopes and see what they do and what could be pick from them etc. Being more aware about our own skiing, the kind of turns etc was also emphasized.

Needless to stay it was a very satisfying first week of lessons and i look forward to more.




Week 2: Learning to be patient.

Saturday was a little frustrating for me, not because of the crowds, I used my atomics and wanted to put into practice the things i learnt in the previous week. Going down chair 9 on goldhill, i just wasn’t feeling it.

I couldn’t get into proper rhythm, wasn’t applying pressure on my feet to initiate the turns, not finishing my turns, accelerating into them and everything was out of place. It felt like i was taking a step backwards instead of forward but i had to tell myself to be patient.

I wasn’t going to be an expert skier overnight, i have to work on one thing at a time and take it step by step. I was expecting too much from myself, too soon. At this point, i didn’t think too much and my first aim was to have fun on the slopes and the rest of the things would follow once i got going. I felt much better after this introspection.

On Sunday, met up at the ski school and we had another addition to our group of three. First couple of runs were again warmup runs on broadway and chair 3. I got the same advice, to be patient and finish my turns :-)

But one of the main things our instructor told us was to hold the poles with open palms which makes it easier to plant them while initiating the turns. It was surprising to see everyone’s reaction, oh this makes so much sense and makes it lot easier. It was a universal reaction from everyone in the group.

We practiced couple of fun drills on way down to chair 10, one of them was the shuffle turns, instead of applying pressure you just hop into the turns. It was a fun drill. The best piece of advice came at the top of chair 10. You have to maintain the body position while skiing and one of the easiest way to do that was to hold the core of body tight.

Just by tightening the core, mainly the abs, it is possible to prevent the body from leaning backwards. Our instructor demonstrated that to us and it made sense immediately. We held out our arms and whenever he tried to push them down, we could feel the core tightening. So just by tightening your abs while skiing and holding your elbows in front of your rib cage, you can prevent your upper body from going backwards. It made a huge difference and was very helpful bit of information.

The final thing which i got out of the lesson was to twist my knees more so that i could finish those turns before initiating a new one. I had more control on my speed doing it that way and combined with tightening of the core it made a huge difference to my skiing.

At the end we did the mogul run, redwing, and i failed horribly on that. Instead of being like a snake who slides over the rocks i was being like one of the drivers who brakes suddenly and then slams on the gas pedal and then brakes again. I know not the right analogy but it was awful.

Like previous week it was another great lesson and its surprising how much difference small pieces of advice can make. I skied cornice, scottys and ricochet at the end of day and i feel that my skiing has definitely improved in just these two lessons. I still suck on the upper parts of these runs but on the lower parts i am more confident. I am leaning forward a lot more while skiing steeper terrain.

There are still times when i don’t tend to complete my turns but the important thing is that i am aware of those times and lot more in control. Even on moguls my confidence has increased a lot and i look forward to more tips/advice next week.




Week 3: Frustrating day of back and forth.

The entire week i was battling cold and if it wasn’t for my class then i wouldn’t have driven up to mammoth. I was expecting to drug myself (over the counter medicines :p) and stay in bed all day saturday. But to my pleasant surprise the vick’s vapor rub worked wonders for me.

I woke up saturday morning feeling a lot better and ready to hit the slopes. I took it easy all day, perhaps little bit too easy, just skiing easy groomed runs and not challenging myself at all. I was just happy to be on the slopes and maybe that is the reason i wasn’t thinking too much about putting into practice the things i had learn’t in past two weeks.

Sunday morning i wasn’t feeling exactly 100% ok and for some reason i had some back pain though it wasn’t that bad. I was sure that i could handle a day of skiing and it would be ok. Met everyone at ski school and the plan was to go over to chair 9/25 area. Skiing down stump alley the focus was going to be on the same things, making sure i twisted my knees to complete my turns, stood up tall etc.

We got on to chair 10 from there headed over to Chair 9, at this point the topic of isolation of upper and lower body came up so we talked about it and at the bottom of goldhill we practiced target turns which focus on the isolation that we talked about earlier.

The goal is to keep your upper body straight while using only your lower body for turning. So we held out our poles and pointed them at a target. We were going to ski down, making wedge turns while not moving our upper body. It wasn’t easy but still achievable and we felt how different muscles come into play as we did those turns.

Another thing we were going to focus on today was our head position, keeping the chin up and looking up, so that not only we choose a line but also make sure that we ski along that line too. I literally took that advice and felt an immediate difference coming down Ricochet but i wasn’t aware of anything else around me and came close to my fellow skier which was bad.

I was glad that nothing happened but it made me realize that looking down the line doesn’t mean that you are not aware of what is going on around you and ski without any concerns. It was a lesson learn’t which i do not intend to forget.

My confidence took a beating and so did my skiing, i could tell that there was a degradation and my instructor also confirmed it. I was really glad that when we were talking about how i was going backwards in my skiing, after a while he decided to change the topic so i didn’t feel any worse.

We did couple of mogul runs and the small consolation for me was that i did better at them than last time. At the end of the lesson i felt that i didn’t learn anything at all in past 3 weeks and it wasn’t a nice feeling. I know i can do a lot better and so after lunch i just decided to ski for a while to see how it went.

I did some easy runs on chair 4 trying to get back into some sort of rhythm and it was slowly coming to me. I also came across a kid on the lift who couldn’t describe exactly where the art park was but happily lead me to it. I went through the park and it is pretty cool, did couple of small jumps too. Slowly but surely i was getting back into rhythm.

At end of day, I went over to check out chair 5 and the wind was blowing some nice snow on the run. I did few runs there and regained back all the lost confidence. I felt really good at the end of the day and as always looking forward to another lesson. :-)


Week 4: Being more patient


I didn’t pay close attention to the snow reports and i was surprised to find out that it was going to snow on sunday. I was glad to know that but was bummed that i didn’t bring my fat skis. Saturday i had fun skiing the groomers and then later in the day chair 5 had some sweet wind blown powder.

I got up ready Sunday morning and took the first chair at eagle. It wasn’t easy for me to be in complete control while making fresh tracks but i still managed to get down to main lodge from eagle without any problems.

The conditions demanded that we modify our skiing style, instead of making those hard turns you just had to glide over the snow and use the edges more subtly. The legs had to be more closer and body more straight.

As soon as we started our lesson we got one important bit of advice, the pole basket. It is something you don’t realize but our instructor suggested that we change the baskets to more wider ones so that when there is fresh powder the poles don’t just go through the snow. I have yet to implement it but it something to keep in mind.

I wasn’t sure that my skis would plow through the tracked snow and it was affecting my skiing. slowly but surely i started to get more confident as we progressed through the lesson but still it wasn’t 100% perfect.

My main problem is that i am not standing up tall enough and then my hands position is also all over the place, not to mention i tend to drop my shoulders. I was trying hard to do everything right but then once i got all that going i wasn’t looking straight ahead. grrr, so many things to get right, why does skiing has to be so technical :-)

The entire time was spent focusing on these basics and sometimes i would get them all right and then at times only some things would fall into place. Later in the day as well after the lesson as i tried to focus on all these things it was hard.

I was worried that if i didn’t look down on the snow with all the tracked snow i would run into crud and fall so i had to keep track of where i was going. But the few times when all of the things fell into place, i could feel a huge difference in my skiing.

The goal moving forward is to keep on concentrating on these basics as I get bombarded with lot more things during this course.




Week 5: Rotary Skills


Saturday was one of the best days on the mountain for me. It was a brief 10 sec moment which made my day i would say. It was crazy windy (50-70 mph gusts) and i was loving the wind blowing against you while coming down cornice or scotty’s.

As i started to come down cornice the wind was so strong that i wasn’t going down the hill, for a good 10 secs i just stood there trying to ski down. It was surreal feeling, very hard to describe in words but i shall try :) . You are on this slope trying to go down with nothing holding you back and then the wind is blowing so hard that you just stand there on an incline in a state of limbo, just awesome.

Sunday morning took the long traverse from chair 9 to main. Our instructor announced that the focus for today’s lesson would be rotary skills which meant we would work on upper and lower body isolation. We started off going to chair 3 and skiing down coyote we practiced sliding down the slope. It was a warmup exercise for something which we were going to practice next, it was sliding turns.

The whole idea of this exercise was to keep our upper body straight while making turns. It was a really helpful exercise for me and it made a huge difference to my skiing. Instead of twisting my knees to complete my turns if i concentrated on this exercise and achieved rotation using my hips i was able to complete my turns before initiating a new one.

Another thing that i had realized that as i held my arms out, i was holding them in such a position that it was difficult for me to do the pole plant. So i had to work on that as well and was holding the poles in such a way that i could reach out and plant them.

We also shot some video footage so that for the next class we could review it and see how we were skiing, i am really looking forward to see it and learn from it.

At the end of class we did couple of mogul runs and nevertheless to say my performance was abysmal. I don’t know what happens as soon as i start on it, all the basics fall out of place. I am not standing up, not looking straight ahead and arms are all over the place.

I definitely have to work on rectifying this and make sure that i ski those mogul runs properly. Today’s lesson definitely helped me a lot and later on while skiing i realized that now my hands get into proper position as soon as i start making turns.

I have started to feel uncomfortable if i make turns with my hands just being straight, i have to bring them up. The muscle memory has definitely kicked in and it feels really good.

Week 6: Back to Basics

As mentioned last time i realized that my hands were coming back up by instinct but still they weren’t in the right position, i was dragging my poles and at times letting my hands drop. I have to work more on maintaining my hands position. As usual Saturday i had blast skiing wind blown powder on chair 5, it was really good.

On Sunday, i got to main lodge for class and after video review we talked about maintaining the hip position while initiating the turn with the pole plant. We practiced the position we should all be in while turning and then headed off to our usual path of going to eagle lodge area.

While going down quicksilver over to chair 9, we observed each other while skiing and tried to figure what we would want to take learn from each others skiing. We decided to come Ricochet from chair 9 and it wasn’t a pleasant experience.

All of us got into defensive mode of skiing so to say because of the variable snow conditions, crowds and trying to put into practice what we have been learning. It was an interesting exercise where one of the things we learnt is how to adapt your skiing style depending on the various factors like above.

We then decided to end the day doing the mogul run, acts, we skied it couple of times and to everyone’s surprise we all were doing lot better on moguls. I also managed to get few proper turns in and did way better.

One of the things that helped me was instead of taking a straight line, my instructor recommended that i take a line more at 4 or 5 clock and that made a big difference.

I met up with another friend who is taking the same program but her class is on wednesdays and we decided to do mogul runs. Going down acts, i fell and went sliding down it. It is not fun sliding down moguls but thats what helmets are for :). Repeated the same run couple of more times and did lot better. Same was the case on Red wing which is mogul run off chair 8.

One thing that my instructor told me that it would be beneficial for me to get new skis. My current skis are too long for me and i would enjoy the class more if i had shorter skis and would learn lot easily than on the longer skis.

I am 170cm and my current skis, Atomics Beta C:18 carvers are the same length. I was suggested to buy good all mountain skis which would have a turning radius of less than 16, length between 163-165 cm and a rounded tail. I don’t mind buying a used pair of skis which fits this criteria and if you of any good ones then do let me know.

Currently i am looking at K2 Apache Interceptors and Fisher Progressors.

Week 7: Confidence in Trees

This weekend because of the big storm brewing i decided to drive up early friday morning and get half day in on friday. Most of the lifts were closed but made the best of what the mountain had to offer. In particular coming down to canyon from roller coaster was a sweet run.

Saturday morning was full of surprise, instead of stormy weather it was a clear blue bird day and it got crowded pretty soon. The lines as soon as the lifts opened were huge but it was all worth it. Not to mention that got an email from our instructor asking to bring the fattest skis that we had, along with getting powder leashes and powder baskets. I knew he had something fun planned for us :)

Sunday was another blue bird day and i was excited to see what was there in store for us. Got to main lodge and we decided to head to the backside and do some tree runs there. I have been wary of doing tree runs because i am not at all confident that while going at fast speeds i will be able to make quick enough turns to avoid collisions.

We went over to chair 12 and the went down to chair 13 through the trees and we were explained how you should pay attention to the exit points and always have multiple exits if possible. After doing couple of runs there we went to chair 14 for some longer tree runs but it got crowded after one run and we got back to 13.

We also talked about pressure control and balance in powder so while making the turns some additional pressure than usual is required on the uphill ski. I was really enjoying this class and so was everyone else in the group.

At the end we decided to head over to Dave’s run. I hadn’t skied the main part of the run but i was up for it. Our Instructor wanted to see which line we all took while dropping in and it turned out that most of us took the steepest section of the run and managed to get down without any problems as such. It was another big confidence booster.

I would have loved to do dave’s few more times but then the line at mccoy was long and it was time for lunch :). Spent rest of the day skiing scotty’s which was chopped up but i wanted to push myself but wasn’t as successful as i had hoped to be.

Week 8: Adhering to Basics

After falling few times last week my legs were hurting little so i decided to take it easy this weekend didn’t want to push myself too much. I have been looking for new skis but haven’t found the right combination of skis and the price.

Saturday i stayed mainly on the groomers, not that i spend entire days off piste :) , and on sunday morning as i got to the slopes i kind of wished that i had my fat skies with me. The top wasn’t open and it was whiteout conditions on most of the mountain.

We headed down to mill and took gold rush and went to chair 25 area in hopes of finding some good tree runs which we did. But unfortunately 25 wasn’t open so we had to ski all the way down to 15. I wasn’t doing that good on my other skis but it wasn’t as bad as i thought.

I am still leaning backwards as soon as i start gaining some speed on these skis, one way to remedy was to open my arms little more so the core muscles would tighten up and prevent me from leaning back. As it is i need to work on my hand position while skiing, i have started to drop them and not holding them in front always.

We then headed over to chair 21 and we spent most of our day trying to find tree runs over that area. I wasn’t doing that good and i was asked to turn using the tip of my skis instead of tails. In order to do that i had to lean more forward and i our instructor was like “duh” skiing 101, after 7 weeks of lessons i finally get it.

I tried to use the tip of my skis to initiate the turns but wasn’t highly successful at it, sometimes they would just cross and it wasn’t fun. I figure once i get shorter skis it will make it easier for me. For the final run we decided to drop into the steep section of Goldrush and again my skis took me for a ride.

We skied down acts and it seems like i am just crouching myself when faced with instability instead of standing up tall and face it. I need to work on it for sure, it was the same case when i hit the crud section on stump alley. At fast speed i was crouching too low to be stable instead of trying to standup tall and make some turns.

At end of day one of my friend’s friend took some video of me while skiing and i could easily see that i was making quick turns with the tails of my skis instead of using the tips to initiate the turn. I would love to post that video, it would be a great reference for me to improve on my mistakes. :)

I finally bought a new pair of 2011 K2 photons which i am excited to try out on the slopes and work on all these things will see how it goes.

No responses yet

Nov 08 2010

Creating Bottom Navigation Bar in Flex Mobile Applications

Published by under Flex,Mobile

When Flex 4.5 “Hero” was announced at MAX i jumped on the chance to play with it. For those who want to get a good basic understanding of how it is different from traditional Flex Application development i would highly recommend this MAX session titled “Deep Dive into Mobile Development using Flex SDK“.

So first thing when i started playing around was that i realized there was no easy way to have a bottom navigation menu like most of the apps. for eg. If you look at the apple app store in the bottom you see  the top navigation menu, middle content area and then the bottom bar. The image below explains what i mean by it.



To get this functionality where you have a constant bottom bar and then the views change when you select the buttons, you have to do little bit of coding and here is how you do it.

The project file can be downloaded here.

This is the main file and we don’t have to make any changes to it, this is what you will get when you create a mobile application.

1
2
3
4
5
6
7
8
9
< ?xml version="1.0" encoding="utf-8"?>
<s :MobileApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.bottombarHome">
    <fx :Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx>
   
    <fx :Style source="style.css" />
</s>

so now lets look at the first view file called bottombarHome, this is where all the action happens.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
< ?xml version="1.0" encoding="utf-8"?>
<s :View xmlns:fx="http://ns.adobe.com/mxml/2009" creationComplete="view1_creationCompleteHandler(event)"
        xmlns:s="library://ns.adobe.com/flex/spark" actionBarVisible="false">
    </s><s :layout>
        <s :BasicLayout/>
    </s>
   
    <fx :Script>
        < ![CDATA[

           
            import mx.events.FlexEvent;
           
            import views.*;
           
            protected function one_clickHandler(event:MouseEvent):void {
                // TODO Auto-generated method stub
                if (!(myNavigator.activeView is One))
                    myNavigator.pushView(One);
            }
           
            protected function two_clickHandler(event:MouseEvent):void {
                // TODO Auto-generated method stub
                if (!(myNavigator.activeView is Two))
                    myNavigator.pushView(Two);
            }
           
            protected function three_clickHandler(event:MouseEvent):void {
                // TODO Auto-generated method stub
                if (!(myNavigator.activeView is Three))
                    myNavigator.pushView(Three);
            }
               
            protected function view1_creationCompleteHandler(event:FlexEvent):void {
                // TODO Auto-generated method stub
                systemManager.stage.addEventListener(KeyboardEvent.KEY_UP, deviceKeyUpHandler);
                //add the first view when this view is created
                myNavigator.pushView(One);
            }
           
            //this is required to handle the device back key
            protected function deviceKeyUpHandler(event:KeyboardEvent):void {
                // TODO Auto-generated method stub
                var key:uint = event.keyCode;
               
                if (key == Keyboard.BACK && myNavigator.navigationStack.length > 1){
                    myNavigator.popView();
                }
            }
           
        ]]>
    </fx>
   
    <fx :Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx>

    <s :VGroup height="100%" width="100%" gap="0">
        <s :ViewNavigator id="myNavigator" width="100%" height="100%" />
        </s><s :HGroup left="0" right="0" bottom="0" gap="0" width="100%" >
            <s :Button label="One" id="one" click="one_clickHandler(event)" />
            <s :Button label="Two" id="two" click="two_clickHandler(event)" />
            <s :Button label="Three" id="three" click="three_clickHandler(event)" />
           
        </s>

ok i have to admit, putting code like this doesn’t make any sense but you will have to trust me that when you run this application you will have a bottom navigation bar which stays in place all the time during lifetime of your application.

There might be other ways to do it and i would like to know but so far i have found this way to be effective.

It would be cool if inside the MobileApplication.as there would be this functionality to add a bottombar and then every view for that button has a “master” viewstack instead of one single viewstack as it is the case right now.

There is one more way of achieving this you can read about it here.

7 responses so far

Aug 23 2010

Busy week ending with a fun day of diving……

Published by under Diving

The Weekend of 08/08/10 was a lazy resting weekend for me and also i found that i had put on weight and not only that but my body fat percentage had increased. So it was time to take some action, it meant going to gym and being more active during the weekdays.

Mon, Tues went to gym after work, wednesday was going to meet with a newbie for climbing in the gym. After being almost dropped by her, i ended up just bouldering since wasn’t confident in her belaying skills and she also got some rope burns.

Thursday Night: Malibu Road Dive with Dana and Andy.

We were planning to dive Vets first but then it was lake pacific and malibu lifeguard reported a viz of 15 ft so we decided to head out to Malibu Road for diving.

As i was driving out to malibu, the ocean was absolutely flat and the conditions on surface looked great. We suited up and as then swam out to the kelp in dark where the main or one of the reefs would be. We dropped down next to the kelp bed but then the viz wasn’t that great, it was about 10 ft and we missed the reef. :(

We were just swimming around trying to find the reef but couldn’t, even though we were going over the sand still came across a lot of critters. Saw a big nudi, large brown shrimps, mating purple glove crabs in different sizes. But since we were going no where and not finding the reef, we decided to surface and then tried to head over to the place where the kelp was.





We did find the reef but it was little late and i was at 1500 psi, it was going to be a long swim back underwater so couldn’t afford to stay longer at the reef. On the way back we again found some cool critters, some octopuses, purple glove crabs, pair of hermissenda’s, long pipe fishes and few big lizard fish.

It was a really nice dive, i thought about staying in water and swimming to the exit point but then decided to get out and walk the distance to the car.

Santa Barbara Island Trip:

Thursday morning i came to know about trip to Santa Barbara Island organized by Laguna Sea Dwellers and i got interested in it. There was still room on it and then the ocean looked calm so it would be an easy crossing over to the island which really made me consider this trip.

It also meant that i would have had to kick out the german couchsurfers at my place but then i had warned them about it before agreeing to host them and they were pretty chill about it too so it was all working out.

I signed up for the trip on friday afternoon and after an evening of climbing indoors i was all set to head out to board Magician. We were going to leave the dock at 2 am so that we could reach Santa Barbara Island early in morning.

I got to the boat, did the paperwork and then immediately went to bed in the single bunk which was assigned to me. It was a comfy spot i got and even though i was next to the engine room i wasn’t complaining. I woke up briefly when the boat started and checked the time, it was 4 am so i figured we weren’t going to Santa Barbara Island :(

Woke up in the morning and we were briefed about the situation, even though the crossing to SBI wasn’t so bad the swells due to the winds were upto 3-4 ft and the conditions for diving would have been miserable. It was decided that we would try to do 4 dives at catalina, goat harbor for the GSB, Rock Quarry for the Scythe Butterfly fish and then Captain Jerry knew a secret spot where the squids were laying eggs and bat rays were close by to feast on them.

I was excited after hearing the plan for the day since i haven’t seen a GSB this year, failed to find the butterfly fish during previous dive to the quarry and have never seen squids either.

First Dive: Goat Harbor.

We all got ready and there was a very weak current running, few people jumped in and the current started getting stronger and Captain Jerry asked us to watch out for it. But as soon as I jumped in it got really strong, we didn’t get close to the site before descending and when we descended i could feel the current, i was kicking hard but going no where.

I was just having a hard time staying at one place, the viz in shallows wasn’t great and later on as it cleared i could see the kelp was jus flat parallel to the bottom, the current was that strong. I had no intention of fighting the current and since the viz wasn’t that great either i decided to end the dive.

I signaled to my dive buddy that i planned on aborting the dive, also since the max depth was 100 ft i had to ascend slowly. I was just having a hard time in preventing myself from being swept by the current, i didn’t want to fight it but had to work hard so that it wouldn’t take me with it.

Upon ascending, i saw that we were really far from the boat and had to swim against the current to get to it. The current line was out too but still i was far from it so i had to swim hard to get to the boat. I was really in trouble at this point because i wasn’t making any progress towards reaching the boat, luckily after a while the raft from the sand dollar came to our rescue and picked us up.

The deckhand on the magician also came out in kayak and helped us around. The boat had removed the anchor and it came to pick us up. It took another half a hour to get everyone back on board safely and it was an interesting experience which i would not like to repeat. Even while doing drift dives in egypt didn’t face such strong currents.

Second Dive: Rock Quarry.

It was now time to move to Rock Quarry where the Scythe Butterfly fish reside, i have dove here once before but didn’t manage to find them, this time i really wanted to. Captain Jerry explained us exactly where to look for them so with excitement i jumped into water.

Everyone, including me wanted to make sure there was no current and that was the case. We descended down the anchor line and started our hunt for the butterfly fish. I came across some funky jelly like thing and then after taking its pic all of sudden my camera started fogging up.



It was really annoying, i didn’t want to miss out on the picture of the butterfly fish but as it turns out when we did find them, they were really skittish and swam away fast. There was no chance for me to take its picture and i didn’t have the patience to wait for it. I was so glad that we managed to find it, as we were heading back to the boat, i came across one of the biggest navanax that i have seen so far.

I brought my dive buddy back and had to show it to him. Saw bat ray at the end of the dive but then we were headed to bat ray city next. I was happy to see it but the joy next dive brought is something that i will not forget for a long time to come :)

Third Dive: Bat Ray City (name given by me)

We then moved to the mystery spot, which i called bat ray city, where there are bat rays along with the squid eggs. Everyone knows about the bat rays but the squids were a recent discovery and the squid eggs are the main reason why rays are there at this spot. In night they like to feed on the squid eggs in the depths and during the day they just hang out and chill in the shallows.

We anchored in a spot such that both the dive sites were easily accessible, since the squids were in 105-110 ft range not everyone wanted to dive down there since it was our third dive of the day. My dive buddy was on 32% nitrox so had to be careful about the depth too.

The plan was to follow the anchor and then go try to find the squid eggs and then on the way back we could visit the site of the bat rays. It would be like best of the both worlds.

We descended down the anchor which was resting in 70 ft of water so had to swim further to find the eggs. Also i didn’t know how steep the floor was so as we kept on going in the same direction as the anchor. It was a gentle slope, 80, 90 ft and 100 ft and no sign of squids.

We saw one or two eggs lying around but not the entire cluster that i was expecting. I didn’t want to continue further because i wasn’t sure if we would have enough gas to get back and do our safety stops and then also if we kept going further it would mean we were getting closer to MOD of my buddy so didn’t want to take that chance.

Little disappointed we headed back and in the shallows reached the spot where all the bat rays were chilling. As soon as we got there all of my disappointment went away. There were so many bat rays at that spot and in all sizes. As soon as we got closer they would swim away, they were alert all the time and would just take off as we got closer.

It was so much fun to see them all over the place, i was beyond thrilled. I was bummed that despite borrowing a new desiccant for my camera it was fogging up but anyway the bat rays were too quick. They never allowed us to get any closer to them so that i could take good pictures.

Swimming around i came across one of the guys from the boat taking pics of the ray, it was as if the ray was posing for him. It wasn’t moving at all, just laying there in sand. I tried taking pictures of this ray but had to be careful so that i don’t disturb it and roeland misses out on some photo opportunities.





Pics Courtesy Roeland.

We swam around for a bit and the reef structure also seemed interesting to explore but we were low on air so it was almost time to end the dive. Once back on board, Cathy and others mentioned how they found the squid eggs, the key was to go north from the anchor and we just went straight ahead.

Fourth Dive: Bat Ray City

I was bummed that we missed out on the eggs but Cathy agreed so lead the next dive and show us the eggs, that was so kind of her. After lunch we geared up and Cathy led us to the eggs. We got down the anchor and instead of going straight up we headed north and all of sudden at 100 ft there were hundreds of squids.

It was such a cool site so see all the squids, the ocean floor was covered with their eggs and hundreds of them were just floating around, mating and laying eggs. It is a sight that i am not going to forget anytime soon. We stayed there for sometime, i tried taking pictures but my camera wouldn’t co-operate.



Pics Courtesy Roeland.

I had 9 mins left on my deco time and my buddy had 4 mins left  and this was our 4th dive of the day so we decided not to push it and headed back to find the bat rays. This time i think we went too far southwest and hence didn’t find as many bat rays as the previous dive but still saw some swimming by.

As we were heading back to the boat, in sand we came across 5-6 skates. I was totally surprised because i swam over top of them and then all of sudden 5-6 of them swam away. It was pretty cool, i was like how the hell i missed them. Moving on i could spot one under the sand barely visible because of its eyes and i knew why i missed them first time.

I was excited to see them and then after a while it was time to end the dive. I was really thankful to Cathy for leading the dive and showing us the squids. I have always wanted to see them at Redondo Canyon but then never got a chance to do so.

Even though it started off not so good it was a great day of diving where i saw different critters and enjoyed diving with Laguna Sea Dwellers.

No responses yet

Jun 07 2010

Memorial Day Weekend dive trip to Catalina and Santa Barbara Island.

Published by under Diving

When i first saw this trip posted on the sundiver website, i was really interested but then when i found out that we would be trying to head out to San Nicholas island i signed up for this trip, my other option for memorial day weekend was ski trip to mammoth but i was told that it could get really crowded there. So booking this trip seemed a no brainer to me.

When i booked my spot i was one of the few people signed so far, so this trip wasn’t 100% but then about a week earlier there were enough people on the boat so i breathed a sigh of relief. It turned out that it was going to be a light load of only 10 people onboard instead of the maximum of 16 which was great.

We were planning to leave at 2 am for one of the islands so i took my sweet time to get to the boat but i was there before midnight and since i was the only one left, as soon as i reached the boat we left for catalina island. I was under the impression that we would try to make it out to san clemente but then the weather wasn’t that great so catalina it was.

One of the best things about having only 10 divers onboard is that there was plenty of bunk space and i had a 2 person bunk to myself, the crossing over to the island wasn’t rough and i manage to get decent sleep.

Day 1: Catalina Island.

After breakfast we decided to go over to little farnsworth and see if it was possible to dive there. Last time when we had tried to dive it the currents were too strong but this time around it wasn’t the case. It was a terrific way to start the trip.

Since i had filled my tank with 37% Nitrox, i swapped my tank with one on the boat which had air and it mean’t i was using a LP 80 with 2442 psi instead of my steel 130. The reason for doing that was that the dive site, little farnsworth, is a deep dive and the sandy part where last time divers found tons of angel sharks is in 110-120 ft range.

Dive 1: Little Farnsworth, Catalina

The plan was to drop down the bow anchor to the pinnacles and then come back up the same way. It was going to be my first 100 ft + dive with my dry suit so i was little nervous but it turned out to be perfectly fine. Dropped down on the anchor line and then started exploring the pinnacles but since the main action was supposed to be in deeper sand i started heading down towards that area.

As soon i started in that area i came across a big Navanax, followed by a porter’s dorid. It was awesome, i was beyond happy and my joy knew no bounds when i found tiny baby porter’s dorid. I took its picture with my finger and it was probably 3/4th of an inch.


Baby Nudibranch

One disadvantage of diving with air that you can’t stay longer at bottom so it was time for me to start heading back. I found couple more nudis before started the ascent and then my dive computer had slapped me a 1 min stop at 10 ft. I decided to do 1 min stops at 70,60,50 and so on so by the time i reached 30 my dive computer was happy with me again that mandatory stop was removed. I didn’t want to piss my computer off on the first dive of a 3 day dive trip :)

On the surface from the boat, we saw a baby mola pass by in 10-15 ft of water, i was bummed that didn’t get a chance to see it while i was in water, oh well i am sure some day.

Captain Ray then decided to head east or possibly backside of catalina and then in evening maybe do the crossing over to San Clemente but as soon as he ventured little out, he saw it wasn’t worth it and immediately turned around. We decided to do our second dive of the day at Twin Rock which isn’t too far from Little Farnsworth.

Dive 2: Twin Rock, Catalina

Since this dive spot sits in 40-50 ft of water i decided to use my big tank and take advantage of Nitrox :). Descended down on the reef and there were sea hare’s all over the place. It was like a sea hare garden, they were huge and black. Laying eggs, mating all over the place. This dive site was a typical rocky reef dive, under the rocks found shrimps hiding, lobsters and the kelp was growing nicely. Even managed to find a moray eel and a navanax.



Sea Hare’s Laying Eggs

After this dive we decided to head to the west side of the island, so after a bit of traveling we came to our next dive site called Candump. Not sure about the name but it was an amazing dive site which had what you would call an underwater garden.

Dive 3: Candump West

It was a short swim to the actual dive site and as i started heading towards it, i ended up going in the area which i wanted to avoid because of it being shallow and it was little surgy. At this point i should mention that during the first dive i was comfortable with my dry suit but then on the shallow dive i had little trouble staying down. It wasn’t a huge deal but i wasn’t 100% comfortable as i would have liked to.

So when i started swimming towards the actual dive site through this path of rocks, i saw a shark swim by. It was a big one too about 4-5 ft, i tried following it but it was surgy and the shark was too quick. I didn’t get a good look at it and no pic either. But i was excited and extra alert to find it again but unfortunately that didn’t happen.

I explored the rest of the dive site and it was absolutely gorgeous. There weren’t many small critters to find or fishes but i was stunned by the underwater flora. There was little bit of surge so i was trying to enjoy that. I stayed at 20-25 ft in the surge and enjoy the view. During dives like this, i really wish i had a better under water rig with strobes and all so i could take better wide angle shots. Currently i have to take them without my flash on and it they don’t come out to be that good :(.

It was almost time to end my dive and big school of bait fish went by me, it was cool. I then saw a purple jelly hanging out at about 10ft or so, i didn’t want to ascend and swim in its direction because i would have then liked to end my end rather than dive down to depth again n explore more. I tried taking its picture from a distance but it wasn’t good so i told to myself what the hell i will end my dive after getting close to it.



Purple Jelly

So i swam upto the jelly and took its pictures and then headed back to the boat. Our next dive was going to be Sea Fan Grotto, as suggested by name in this case this dive site has walls which are covered by Sea Fans.

Dive 4: Sea Fan Grotto

For some reason we were anchored little farther from this site and it was a fair amount of swim underwater to find the actual site along the walls. As we were traveling along the walls i came across an octopus hiding in one of the holes. Finally managed to find the site and it was great, sea fans all along the wall. It was really nice.

At the end of the dive, i was just hanging out at 15 ft doing a safety stop and a huge school of bait fish went past me, it was such a surreal experience watching them go past me so close. For a moment i was in state of trance with their shining scales reflecting the sunlight and they were in thousands. It was a truly amazing experience for me, i can never forget it. I just wanted to stay there and watch them swim by me over and over again. That definitely made my day.

We settled down at eel cove for the night and it seemed like i was the only one who was keen on the night dive :(, so it didn’t happen and everyone called it an early night. Since San Clemente crossing didn’t look good, it was decided that we will try to make it to Santa Barbara

Day 2: Catalina and Santa Barbara

Dive 5: White Rock, Catalina.

We moved over to dive white rock which is very close to sea fan grotto and absolutely amazing site with some caves. As i started going towards the area where the caves are located, this dive site seemed like a typical one but then i got a different impression as soon as i got to the caves.

In the small ledge, there was 4-5 ft horn shark resting which was great and there were few kelp bass and a giant sea bass hanging out with the shark it was cool. Unfortunately none of us could manage to get a good picture of that shark, the entrance to the cave was from the other side and i decided to venture in there.

It was a very unique experience and it gave me a feeling of what it is like to do cave diving. My light wasn’t that strong enough so i didn’t want to venture too much in and knowing there was a shark already there, i didn’t know what else could be lurking around so after just going in about 20 ft or so i decided to head back. :).



View from Inside the Cave

A spooky and very interesting experience, i have mixed feelings about it but i think i will dig cave diving for sure. It was very different experience from the wrecks that i have penetrated in red sea, just wasn’t the same.

On the way back, i spent time exploring the rest of the reef and came across few horn sharks but these were juveniles more like 1-2 feet long. This dive gave me first taste of cave diving and i was happy about it.

Dive 6: Yellowtail Reef, Catalina.

I was really glad to see that the sargassum was dying on most of the dive sites and the kelp was growing really well. This dive site was also the same, even though i didn’t come across any exciting or spectacular marine life as such but i still had a good time exploring the reef and going through the kelp.

Even though it was bright and sunny outside, there were times when the kelp got so thick that it blocked all the sunlight and it got really dark. Again, It was little weird and spooky but i still enjoyed it.

Dive 7: Starlite cove, Catalina.

Before this dive i changed my camera battery and in the process some moisture got in and the silicon gel wasn’t absorbing the moisture. I was hoping that i didn’t come across something really cool during this dive and not be able to take its picture. :)

I think i found few interesting critters on this dive but nothing exceptional, it was a typical rocky reef with all the usual suspects. We were moving to the west side of the island so that we could head over to santa barbara island for a twilight/night dive.

Dive 8: Iron Bound, Catalina

This dive site had quite a bit of surge and probably the thickest kelp i have ever encountered. If you were to surface under the kelp chances are you would still be in 5-10 ft of water. There was an area of the site where quite a few kelp holdfasts were off the ground.



Kelp off the ground

I just explored the site and was just having fun hanging out in the surf zone and let the surge push me around. I really enjoy doing that, just practice my buoyancy and let the surge take me whereever and push me around. I have to admit, i was getting little bored of the site since the previous one was also very similar but then i got a reminder of why i love diving.

Even if you dive the same site over and over again the underwater environment is so dynamic that it is never going to be the same, that is the nature of diving. I was about to end the dive and a big bat ray zoomed right past me, i tried following it and wasn’t very successful but still managed to get a decent shot of it.

It was now time to do the channel crossing and head over to Santa Barbara, it also mean’t that after lunch there was time for a nice nap :)

Dive 9: Rookery, Santa Barbara Island.

After a refreshing nap it was time to do the twilight dive, my ears were bothering me somewhat since the second dive and at this point they were practically shut. I had popped in sudafed and was hoping for the best, i decided to attempt to dive and see how it goes.

I discovered a day later that this is the dive site at Santa Barbara which is famous for sea lions and there were couple of curious ones approaching us but they weren’t in mood to play. For this dive only 3 of us ventured into the water, there were another two divers planning on joining us but the possibility of a fog approaching deterred them. Luckily for us that fog never rolled in which was great.

As we dropped down my ears weren’t co-operating with me and for a while i thought about heading back to the boat. But me being me, i persisted and tried to clear out my ears and voila i managed to get down to 25ft. I knew it wasn’t going to be a deep dive so thats the depth i needed my ears to equalize and i was glad.

I wasn’t going to lead or navigate this dive so i was more than happy to follow the others, we didn’t come across something spectacular, it wasn’t too dark so there was still some natural light left. The dive site was a garden for Sea Hare’s but the ones out here were not big black ones like catalina but more of small medium sized and brownish colored.



Brown Sea Hare

After this dive, i was excited but worried as well for tomorrow. We were planning to dive the black caverns, which sits in a depth of 60-100 ft so i wasn’t sure if my ears would equalize but i didn’t want to miss out on the dive either. I popped in another dosage of sudafed and hoped for the best. :)

Day 3: Santa Barbara Island

I woke up and my ears felt alrite they weren’t puffy but not totally clear either. I tried equalizing them on surface and one of them opened little but other was still blocked. I was offered some nasal rinse and i gladly took it up, its not advised but i was really keen to dive this spot and i am glad i took it.

We tried to anchor at some better spot than black caverns but being out in the ocean there was some current out there so we moved to black caverns. This is also out in middle of the ocean but closer to the island and the current was non-existent out there.

Dive 10: Black Caverns, Santa Barbara Island.

The anchor was siting in 100+ ft of water and were supposed to follow it to the cavern which rests in 60-90 ft of water. I was glad that there was an anchor chain to descend so that i could take my sweet time to clear out my ears and then descend but then it was a pleasant surprise that my ears cleared out perfectly. I had no issues whatsoever.

The viz was great and as soon i got to the bottom of the anchor, i saw that the sea floor was littered with hydriods, brittle stars and some huge sun stars. It was a sign of things to come and then as i came to the caverns, they were amazing. It had a huge tunnel which was about 50-60 ft long, i went through the other end and then wanted to ascend on top to explore the reef but then i decided against it. There was a sea lion following us inside the tunnel which was cool.

I didn’t know the exact topography of the site and the tunnel was in 80-90 ft of water so didn’t want to get low on air or something if had to swim back through it again. So i headed back and explored the reef structure. After a while i had to stop counting the number of nudis i was finding, they were all over the place, mainly dorids and hermisenda crassonis.


Anemone, my best pics so far are of them.

As i was hanging around and about to end my dive, Chris, who is a marine biologist, asked me to come over to the other side and take picture of something. I was excited about but unfortunately it was a fish he had never seen before and it swam away before i got there. :(

It was time for me to head back, do the safety stops and all that stuff. I didn’t want to descend down to 100ft again and try to find the anchor and following it up, instead i just followed my gut and tried to locate the chain midway at about 60 ft. Not a smart move without a compass heading or a compass and it also mean’t that i would out in the middle of the ocean without any reference.

It was an interesting experience to do safety stops out in middle of ocean where i could have been easily been carried away by any current but i had rough idea where i was and there were no currents. I was little bit tensed but a sea lion and some pelagic tunicates accompanied me during this interesting phase of the dive which helped me a lot.

It seemed like a foolish decision but i experienced something which made it worthwhile, it was a moment where you know its very easy to go in panic mode but still you have to keep your calm. Being in middle of ocean 15-30 ft underwater with nothing for visual reference you get this feeling of how small and insignificant you are compared to everything else around you. I am glad i got to experience it and when i popped up on the surface, i wasn’t too far from the boat. :)

I had such an amazing dive that if we decided to return at that point, i would have been content. I was glad that we were doing 2 more dives before returning but i would have been ok if the trip would come to an end.

Dive 11: Third Rock, Santa Barbara Island.

We didn’t move too far from the first dive site and then were anchored in this open ocean again but this time we were lot closer to the island and the depth was only 45 ft. Captain Ray mention that this site is like a ridge with quite a few tunnels and lot of structure. The anchor laid directly on top of the dive site so all we had to do is follow it.

The viz was so good that we could see the bottom from the surface, dropped down and then proceeded to explore the dive site. The was this nice narrow tunnel which was lot shorter than the one at black caverns and this time i came out from the other side and explored the structure behind.

The reef was littered with all kinds of stuff and had lot of structure to it. There were legdes, some small caves, some small holes through which you could barely swim through, it was superb. I managed to find some nudis but there was quite a bit of surge and it was hard to stay in one place to be able to take pics.

I came across a jelly/salp i am not sure what exactly it was, haven’t bothered to id it yet, apart from that nothing too exciting but i was just having a great time exploring the structure and enjoying the surge.



Jelly mostly

Dive 12: Rookery, Santa Barbara Island.

For the final dive we decided to head back to rookerie which is famous for sea lion interaction but unfortunately for us not many were interested. I didn’t know earlier that it was the same site where we did the twilight dive. It came as no surprise to me because i again mainly found only sea hares :)

There were two patches of kelp out there, one was thin because of the sea urchins where as other side seperated by sand patch was a thick area of kelp. At the end of the dive, i decided to hang at 15ft in a bid to attract some sea lions if they wanted to come out and play but they would just swim around me for sometime. They were in no mood to play. It was a nice relaxing dive to end what had been a great weekend.



It had been an amazing weekend for me and with the variety of dive sites we dove i came to realize something important. While diving it is the fear/excitement of the unknown which gives me that adrenaline rush. When inside the cave, the dark area of site covered with kelp, the shark which swam away or the safety stop in middle of ocean all these times i felt challenged to keep my calm, i was on the edge all the time. It was something that i have never felt before and i have come to realize that i really relished that challenge. There will be many more such situations and i hope that i do manage to keep my cool :).

Facebook link for more pics.

One response so far

May 18 2010

Flex Skinviewer Application

Published by under Flex

Since i started playing with Catalyst, i was disappointed that you couldn’t edit the code and then view how it had affected your component. There had to be a better way or some utility which would allow you to modify the code for skin file and then preview the component.

So when AIR 2.0 was announced with nativeprocess API, i figured it would be the perfect tool to develop something like that and here it is.

During the development, I was past the single component preview pretty easily but then multiple component files i wasn’t sure how to incorporate them. But after little bit of thinking and playing around i managed to get it going too.

I thought about integrating Shibuya for this application but then i decided not to.

I have created an entire new page for this Skinviewer application and it can be found out here.

Your feedback is highly appreciated, i know its a crappy design for the page.

No responses yet

Apr 28 2010

Using new StyleManager in Flex 4

Published by under Flex

With Flex 4 the StyleManager is no longer a Singleton class. Its implementation has changed so that every loaded module has its own instance of StyleManager.

This post by Gaurav Jain explains how you can use it so that the loaded modules have their own separate style manager.

But it doesn’t say how you can access the toplevel or default StyleManager.

The old, Flex 3, way of accessing it would be,

var tempStyle:CSSStyleDeclaration = StyleManager.getStyleDeclaration(“.tempStyle”);

the above method is deprecated and will give you a warning.

The correct way now of using the StyleManager would be the following,

var tempStyle:CSSStyleDeclaration = StyleManager.getStyleManager(null).getStyleDeclaration(“.tempStyle”);

StyleManager.getStyleManager(null);, returns the top level instance of StyleManager.

5 responses so far

Apr 12 2010

Hacking Flash Builder 4 Help

Published by under Flex

Its been about two weeks since i installed Flash Builder 4 (Flex 4) and when i fired up the help i was throughly disappointed. Adobe has come up with an air app which launches and fetches the help over the net. It is a really annoying system and i hate it, absolutely hate it.

I have always relied on the class reference which uses the eclipse help system and it opens up in my browser on OS X which i really like. I can be offline and still have a neat way of accessing help. I figured it won’t take much for me to hack up the current help so that i could access it within Flash Builder 4 and i was successful at it.

If you select Flash Builder > Help > Eclipse Help you won’t see the Adobe Flex 4 Language reference, i hacked it so that i could have the reference in a neat way without having to go through the hassle of looking for classes etc.

Before the hack: this is how the eclipse help section looked.



and then after my hack and generating the right xml by using the air app.



Before you proceed, here are few disclaimers/requests:

  • I have developed/tested it out on OS X so if you are using windows i am not sure how it affects you.
  • I do not intend to test it out on windows, if it doesn’t work for you on that platform i am sorry i can’t help it. Right now there is no incentive for me to play with it on windows.
  • I am sharing the code for this one, if you want to modify it then feel free to but i would appreciate that you give me some credit.
  • I have tried to make it as efficient as i could think of, though i haven’t played a lot more in trying to make it run faster. If you end up running it faster then i would like to know about it, thank you.
  • If you run the app by itself there are not many messages and stuff so even if it crashes or stops processing, you won’t be able to tell. So therefore i am just including the source for the app and not the app itself.

The requirements for this app to run properly,

  • Adobe Flex 4 language reference, it can be downloaded here. Download the Full Documentation.
  • Local server which would point to the AS3_Reference as docroot, so http://localhost would give you the Flex 4 documentation.
  • myindex.html file which i have created just copy the source when you open it, is it pretty basic and uses jquery.

Before you start wondering why i had to go all this trouble of using custom index,local server etc, please read the source code. I have commented the reason for me taking this approach. I wanted to do a fast, efficient way of doing this without much of hassle and this i felt was the best way.

Here is the link to the uploaded Flex project file. I would recommend that you run this in debug mode so that you see some of the traces or can add your own.

NOTE: Please remove the files arguments.html, int.html and uint.html from your AS3_Reference directory so that they don’t mess up parsing, i didn’t bother to look deeper into the files to see what was causing problems. Since it was only these 3 files as compared to 2483 other html reference files i don’t think its a big deal. :)

Final Step:

Once you have your tocAPI.xml file generated on your desktop, you will have to copy that into the toc xml file. This toc xml file should look some thing like this,

<toc label=”Adobe Flex 4 Help”>
<topic label=”About Web Help and Community Help” href=”html/index.html”/>
</toc>

the path for this file on my computer is, /Applications/Adobe Flash Builder 4/plugins/com.adobe.flexbuilder.help_4.0.0.272416

I modified this file to look as follows,

<toc label=”Adobe Flex 4 Help”>
<topic label=”About Web Help and Community Help” href=”html/index.html”/>
<topic label=”Adobe Flex 4 Language Reference” href=”AS3_Reference/index.html”>

<!– the contents of tocAPI.xml should be pasted in here –>

</topic>

</toc>

I tried using the &lt; link toc=”tocAPI.xml” /> but it doesn’t work so had to copy the contents of tocAPI.xml into this file.

Also make sure you copy the AS3_Reference folder into this directory so that the next time you fire up Flash Builder 4 you will have an indexed class reference.

If i feel like it, i might make more modifications so that the package list is also displayed etc but i barely use it so for now i am happy with this.

I hope there are other developers who felt the same way as i did after checking out the FB help and will use this. Finally if you don’t want to worry about this AIR App and just want to copy the tocAPI.xml file then i have uploaded one for you to download. Enjoy.

Update 05/04/11: I have uploaded a new File for Flex 4.5 it can be downloaded here and the documentation for this is in this zip available here. Name this folder as Flex in your help plugin directory.


3 responses so far

Next »