How to get iOS 7 action bar look in flex mobile application, I want my action bar to be completely flat and semi transparent too, I have seen few posts; those talks about making action bar flat by custom skin but no one talks about transparency.... any help or point to right direction would be greatly appreciated....
All you need to do is set the alpha property on your custom skin:
From Adobe's help documentation:
I added a transparent fill to the button's background/border <s:Rect>
<?xml version="1.0" encoding="utf-8"?>
<!-- SparkSkinning/GlobalVariableAccessorExample.mxml -->
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script>
public var myLabelString:String = "Hello World";
</fx:Script>
<s:Button skinClass="mySkins.GlobalVariableAccessorSkin"/>
</s:Application>
<?xml version="1.0" encoding="utf-8"?>
<!-- SparkSkinning\mySkins\GlobalVariableAccessorSkin.mxml -->
<s:Skin
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
minWidth="21" minHeight="21">
<fx:Metadata>
[HostComponent("spark.components.Button")]
</fx:Metadata>
<fx:Script>
import mx.core.FlexGlobals;
[Bindable]
private var localString:String = FlexGlobals.topLevelApplication.myLabelString;
</fx:Script>
<!-- Specify one state for each SkinState metadata in the host component's class -->
<s:states>
<s:State name="up"/>
<s:State name="over"/>
<s:State name="down"/>
<s:State name="disabled"/>
</s:states>
<s:Rect
left="0" right="0"
top="0" bottom="0"
width="69" height="20"
radiusX="2" radiusY="2">
<s:stroke>
<s:SolidColorStroke color="0x000000" weight="1"/>
</s:stroke>
<!--
This section added to demonstrate
-->
<s:fill>
<s:SolidColor color="0x999999" alpha="0.5"/>
</s:fill>
<!-- ----------------------- -->
</s:Rect>
<s:Label id="labelDisplay"
text="{localString}"
horizontalCenter="0" verticalCenter="1"
left="10" right="10" top="2" bottom="2">
</s:Label>
</s:Skin>
Related
this is what I created in my TiledMap Editor:
But when I try to display it in simulator, it becomes this:
You can see some of tile images are missed, some are wrong(the place where dirt.png should be become wall.png instead). I don't know why this happened. I follow the tutorial and add the following code in the HelloWorld project.
// create a TMX map
auto map = TMXTiledMap::create("tile/test.tmx");
addChild(map);
the content of test.tmx:
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" renderorder="right-down" width="10" height="10" tilewidth="36" tileheight="36" nextobjectid="5">
<tileset firstgid="1" name="test" tilewidth="36" tileheight="36">
<tile id="0">
<image width="36" height="36" source="dirt.png"/>
</tile>
<tile id="1">
<image width="36" height="36" source="floor.png"/>
</tile>
<tile id="2">
<image width="36" height="36" source="wall.png"/>
</tile>
</tileset>
<layer name="Tile Layer 1" width="10" height="10">
<data encoding="base64" compression="gzip">
H4sIAAAAAAAAA2NkYGBgRMMwgM7GhRnQaEJmMaCJ4zILXS8+dbjsxOY+XO4g5FZ0M0GAiQBGV49PDwgAAKCoyOyQAQAA
</data>
</layer>
<objectgroup name="Object Layer 1">
<object id="1" name="SpawnPoint" x="125" y="133" width="67" height="62"/>
</objectgroup>
</map>
Could any one give me a hand?
okay... I have found why....
There are limitations which cocos2d-x support Tied Map Editor.
in this page, http://www.cocos2d-x.org/wiki/TileMap, it says:
Tiles:
- Embedded tiles are NOT supported (i.e., tilesets with embedded images).
- Only embedded tilesets are supported (i.e., the tileset is embedded, but not its images).
- supports at most 1 tileset per layer.
So.... each of tilesets MUST only contain one image.
And... each of layer MUST only contain one tilesets.
If you don't follow the rule while editing map in the Tied Map Editor. The result will become chaos like mine.
I need to do a simple task but it looks like very heavy for me, i need to create XULRUNNER system which opens WWW.test.com in default window without address bar or any menu and nothing more, here are my codes but it doesn't seem to be working, can anybody help?
main.js
function url() {
windowObjectReference = window.open("http://www.test.com/", "test_WindowName", strWindowFeatures);
}
main.xul
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="main" title="My App" width="500" height="500" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://myapp/content/main.js"/>
</window>
pref.js
pref("toolkit.defaultChromeURI", "chrome://myapp/content/main.xul");
pref("toolkit.defaultChromeFeatures", "chrome,dialog=no,all");
pref("toolkit.singletonWindowType", "xulmine");
/* debugging prefs, disable these before you deploy your application! */
pref("browser.dom.window.dump.enabled", true);
pref("javascript.options.showInConsole", true);
pref("javascript.options.strict", true);
pref("nglayout.debug.disable_xul_cache", true);
pref("nglayout.debug.disable_xul_fastload", true);
Just use the <browser> element
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="main" title="My App" width="500" height="500" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://myapp/content/main.js"/>
<vbox id="browerbox" flex="1">
<browser flex="1" id="testbrowser" src="http://www.test.com/ />
</vbox>
</window>
The browser is very powerful element I would read up on all Attributes, Properties and Methods that you can use with it, https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/browser. What I gave you above will work but depending on what you ultimately need to do, you may need make a few changes.
I am using the WebHarvest tool to scrape web data from a few websites. I have gone through the examples, but was not able to find a way to authenticate in websites and then scrape data from them.
Can anyone please cite an example configuration to achieve web data scraping through authentication? How do I send the login parameters and then receive the home page content? Appreciate your help on this.
I just modified one example (http://web-harvest.sourceforge.net/samples.php?num=4) of Web Harvest and it is running fine with login credentials. You may get updated code and try:
<?xml version="1.0" encoding="UTF-8"?>
<config charset="ISO-8859-1">
<!-- sends post request with needed login information -->
<http method="post" url="http://www.nytimes.com/auth/login">
<http-param name="is_continue">true</http-param>
<http-param name="URI">http://</http-param>
<http-param name="OQ"></http-param>
<http-param name="OP"></http-param>
<http-param name="USERID">web-harvest</http-param>
<http-param name="PASSWORD">web-harvest</http-param>
</http>
<var-def name="startUrl">http://www.nytimes.com/pages/todayspaper/index.html</var-def>
<file action="write" path="D:/nytimes/nytimes${sys.date()}.xml" charset="UTF-8">
<template>
<![CDATA[ <newyourk_times date="${sys.datetime("dd.MM.yyyy")}"> ]]>
</template>
<loop item="articleUrl" index="i">
<!-- collects URLs of all articles from the front page -->
<list>
<xpath expression="//div[#class='story']">
<html-to-xml>
<http url="${startUrl}"/>
</html-to-xml>
</xpath>
</list>
<!-- downloads each article and extract data from it -->
<body>
<xquery>
<xq-param name="doc">
<var name="articleUrl"/>
</xq-param>
<xq-expression><![CDATA[
declare variable $doc as node() external;
$doc
]]></xq-expression>
</xquery>
</body>
</loop>
<![CDATA[ </newyourk_times> ]]>
</file>
</config>
I am having issues to remove a PopUp form my application. In fact I have a title Window with a component in it. In the component I have a Button, which when clicked should remove the TitleWindow (the PopUp). I am getting the error :
TypeError: Error #1009: Cannot access a property or method of a null object reference.
My Title Window is as follows:
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" left="10"
width="1366" height="768">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
public function removeTitleWindow():void {
PopUpManager.removePopUp(this);
}
]]>
</fx:Script>
<s:VGroup width="100%" height="100%" horizontalAlign="left">
<comps:SearchEngine />
<comps:SearchResults />
</s:VGroup>
</s:TitleWindow>
My Component is as follows:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="400 " height="300">
<fx:Declarations>
</fx:Declarations>
<fx:Script>
<![CDATA[
]]>
</fx:Script>
<s:Button label="Cancel" click="parentApplication.parentApplication.removeTitleWindow()"/>
</s:VGroup>
</s:Group>
Can someone help me on this?
Thanks
Got it Mates :)
I tried using parentApplication or rather flexGlobals.top... It didnt work.
Hence I used parentDocument.methodName().
This solved the issue.
I am trying to add an icon in context menu but don't know why it is not showing.
Here is the complete code:
chrome.menifest
content xulschoolhello jar:chrome/xulschoolhello.jar!/content/
skin xulschoolhello classic/1.0 jar:chrome/xulschoolhello.jar!/skin/
locale xulschoolhello en-US jar:chrome/xulschoolhello.jar!/locale/en-US/
overlay chrome://browser/content/browser.xul chrome://xulschoolhello/content/browserOverlay.xul
style chrome://browser/content/browser.xul chrome://xulschoolhello/skin/browserOverlay.css
browserOverlay.xul
<?xml version="1.0"?>
<!DOCTYPE overlay SYSTEM
"chrome://xulschoolhello/locale/browserOverlay.dtd">
<overlay id="xulschoolhello-browser-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
.
.
.
<!-- Context menu additions -->
<popup id="contentAreaContextMenu">
<menuseparator id="ss-context-menu-separator"/>
<menuitem id="ss-context-menu-item" class="menuitem-iconic"
label="click me"
oncommand="XULSchoolChrome.BrowserOverlay.sayHello(event);"/>
</popup>
</overlay>
browserOverlay.css
#ss-context-menu-item {
list-style-image: url("ss_16.png");
}
Any idea about problem?
From my tests with my own extension, I think that maybe you have to add a reference to the stylesheet in the overlay, in addition to the one in chrome.manifest. To do this you have to add the following line before the doctype declaration:
<?xml-stylesheet href="chrome://xulschoolhello/skin/browserOverlay.css" type="text/css"?>
If you don't put the file name, leaving only chrome://xulschoolhello/skin/, it should also work, according to the tutorial.