Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6772017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:30:00+00:00 2026-05-26T15:30:00+00:00

I’m trying to simply move the actionBar down 75 pixels so I can squeeze

  • 0

I’m trying to simply move the actionBar down 75 pixels so I can squeeze an adMob ad in there.

I tried:

navigator.actionBar.y=75;

But, i’m not seeing anything different visually, it’s not moving, it’s giving me no errors, but if i do trace(navigator.actionBar.y); it claims it’s at 75….even though it’s clearly not on the screen.

Does anyone have any ideas? Also, this would only be for ONE view, I can’t use a solution that would move the action bar down throughout the entire application. I just need it moved down in THIS particular view.

Thanks!

EDIT:
@Brian,
Thanks for the suggestion, almost done this whole mess. I’m trying to make a function inside the skin to add the space for the adMob ad. But, I don’t think im referencing the function correctly, because when i do it im not getting any errors, and nothing is happening.

<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" >
    <!-- host component -->
    <fx:Metadata>
        [HostComponent("spark.components.ViewNavigator")]
    </fx:Metadata>
    <fx:Script>
        <![CDATA[

            public function adMobVisible(trueOrFalse:Boolean):void
            {
                if(trueOrFalse)
            {
                main_group.top=70;
            }
            else
            {
                main_group.top=0;
            }
            }

        ]]>
    </fx:Script>

    <!-- states -->
    <s:states>
        <s:State name="landscapeAndOverlay" />
        <s:State name="portraitAndOverlay" />
        <s:State name="landscape" />
        <s:State name="portrait" />
        <s:State name="disabled" />
        <s:State name="normal" />
        <!-- <s:State name="admob" /> -->
    </s:states>

    <s:VGroup id="main_group" width="100%" height="100%">
        <s:ActionBar id="actionBar" width="100%" />
        <s:Group id="contentGroup" width="100%" height="100%" />
    </s:VGroup>
</s:Skin>

I did:

import skins.AdMobHolderSkin;

protected var ad:AdMobHolderSkin = new AdMobHolderSkin();

up top… then I just tried to do a simple thing like:

ad.adMobVisible(true);

But nothing happens. Any ideas? Thanks for helping with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:30:01+00:00Added an answer on May 26, 2026 at 3:30 pm

    If you inspect the code for ViewNavigatorSkin, you will find that it lays out its two items (ActionBar and Group) using simple math. In other words, it is not using a layout container in which setting top or y will have any effect.

    Instead, you need to skin the ViewNavigator. First, define the skin (notice how I set the top="75" in the VGroup :

    VNSkin.mxml

    <?xml version="1.0" encoding="utf-8"?>
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
            xmlns:s="library://ns.adobe.com/flex/spark">
        <!-- host component -->
        <fx:Metadata>
            [HostComponent("spark.components.ViewNavigator")]
        </fx:Metadata>
    
        <!-- states -->
        <s:states>
            <s:State name="landscapeAndOverlay" />
            <s:State name="portraitAndOverlay" />
            <s:State name="landscape" />
            <s:State name="portrait" />
            <s:State name="disabled" />
            <s:State name="normal" />
            <s:State name="moved" />
        </s:states>
    
        <s:VGroup width="100%" height="100%" top="0" top.moved="75">
            <s:ActionBar id="actionBar" width="100%" />
            <s:Group id="contentGroup" width="100%" height="100%" />
        </s:VGroup>
    </s:Skin>
    

    Then, inside of my main application, I will skin the ViewNavigator to use this skin:

    MyApp.mxml

    <?xml version="1.0" encoding="utf-8"?>
    <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.ActionbarMoveHomeView" applicationDPI="160" >  
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            s|ViewNavigator {
                skinClass: ClassReference("VNSkin")
            }   
        </fx:Style>
    </s:ViewNavigatorApplication>
    

    Finally, in my view, I need to set the state and put it back when the view is activated and deactivated:

    MyView.mxml

    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
            xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
    
        <s:viewActivate>
            navigator.skin.currentState = "moved";
        </s:viewActivate>
    
        <s:viewDeactivate>
            navigator.skin.currentState = "normal";
        </s:viewDeactivate>
    
        <s:Label text="test" click="navigator.pushView(SecondPage)" />
    </s:View>
    

    Note that this technique adds some overhead because your ViewNavigator skin is now MXML instead of pure ActionScript. You might consider creating a skin in pure ActionScript based off the ViewNavigatorSkin source code such that you can place it with your offset… but if you aren’t noticing a huge performance hit from the MXML skin, I wouldn’t worry about it.

    EDIT
    I noticed after I wrote my answer that you only want it for one view. I have made a modification to add a state to the VNSkin class and then switch the states in the view code (viewActivate and viewDeactivate. For the record, this all feels like a hack. I’d consider some sort of notification mechanism so that you can communicate to the skin in order to change in a way other than this… but I have at least put you on a path to doing this with one technique. I’d love to see someone come here and suggest something better. Until then, you have something that works 😛

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.