-
+4
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
UTF8 = {
encode: function(str){
for(var c:String, i:Number = -1, l:Number = (str = str.split("")).length, o:Function = String.fromCharCode; ++i < l;
str[i] = (c = str[i].charCodeAt(0)) >= 127 ? o(0xc0 | (c >>> 6)) + o(0x80 | (c & 0x3f)) : str[i]
);
return str.join("");
},
decode: function(str){
for(var a:Array, b:Array, i:Number = -1, l:Number = (str = str.split("")).length, o:Function = String.fromCharCode, c:String = "charCodeAt"; ++i < l;
((a = str[i][c](0)) & 0x80) &&
(str[i] = (a & 0xfc) == 0xc0 && ((b = str[i + 1][c](0)) & 0xc0) == 0x80 ?
o(((a & 0x03) << 6) + (b & 0x3f)) : o(128), str[++i] = "")
);
return str.join("");
}
};
Это чудо народного зодчества было предложено в качестве конвертора из ASCII в UTF8 и обратно. Проблема осложняется тем, что человек так делает в полной уверенности, что он что-то соптимизировал. (Ну и конечно, китайцы со своими иероглифами, как всегда в пролете, а так же французы со своими диакритиками, поляки, немцы и т.д.). То что страдает типизация и инкапсуляция, просто меркнет перед форматированием и полным отсутствием здравого смысла.
http://www.kirupa.com/forum/showthread.php?t=351816
Запостил:
wvxvw,
25 Июля 2010
-
+12
- 1
- 2
model.issuesSubproduct = subproductId;
subproductId = model.issuesSubproduct;
Two-way binding :D
Запостил:
dimas_art,
07 Июля 2010
-
+3
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
public function clearGrid():void
{
if(clearGrid != null)
{
if (selectedChild is AbstractIssueGrid)
{
(selectedChild["setGridDataProvider"] as Function) (new ArrayCollection());
}
}
}
Держите меня семеро Х_х
Запостил:
dimas_art,
30 Июня 2010
-
+3
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
if (!DocumentClass.getInstance().branding)
DocumentClass.getInstance().branding = new Branding;
if (!DocumentClass.getInstance().encryption)
DocumentClass.getInstance().encryption = new TEAEncryption;
if (!DocumentClass.getInstance().eventManager)
DocumentClass.getInstance().eventManager = new EventManager;
if (!DocumentClass.getInstance().panelManager)
DocumentClass.getInstance().panelManager = new PanelManager;
if (!DocumentClass.getInstance().playLogger)
DocumentClass.getInstance().playLogger = new PlayLogger;
if (!DocumentClass.getInstance().sharedObject)
DocumentClass.getInstance().sharedObject = new SharedObjectManager;
if (!DocumentClass.getInstance().soundManager)
DocumentClass.getInstance().soundManager = new SoundManager;
if (!GameDocumentClass.getInstance().dataManager)
GameDocumentClass.getInstance().dataManager = new DataManager;
Кусочек template для игростроя :)
Запостил:
dimas_art,
08 Июня 2010
-
+4
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
private static function copyByteArray(source:ByteArray, destination:ByteArray, length:uint = 0):void
{
var oldPosition:int = source.position;
source.position = 0;
destination.position = 0;
var i:uint = 0;
while (source.bytesAvailable > 0 && i < length)
{
destination.writeByte(source.readByte());
i++;
}
source.position = oldPosition;
destination.position = 0;
}
Только вы не думайте, что это школьная лаба. Это все он же родимый, Flex framework, mx.utils.Base64Decoder, прошу любить и жаловать! :)
Для тех, кто не в курсе, у ByteArray есть "родные" методы readBytes и writeBytes которые делают то, что описано в этом методе, ну только в пару раз быстрее...
Запостил:
wvxvw,
05 Июня 2010
-
+4
- 1
if(_smcWindowContent._smcShowOnStartup.contains(_smcWindowContent._smcShowOnStartup._sbtShowHelpOn))_smcWindowContent._smcShowOnStartup.removeChild(_smcWindowContent._smcShowOnStartup._sbtShowHelpOn);
(c) Tom Wrasseller Flash Lead of Arkadium Games
Запостил:
dimas_art,
19 Мая 2010
-
+1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
_data_provider.request(DataProvider.GET_USER_INFO,
{
onComplete: function(data)
{
self._user_info.user_id = data.user_id;
self._user_info.user_name = data.user_name;
// Make next request after 500 ms delay because of API restriction (3 reqsts per second)
setTimeout(function()
{
self._data_provider.request(DataProvider.GET_SERVER_TIME,
{
onComplete: function(data)
{
var current_time = (new Date()).getTime();
self._time_offset = current_time - parseInt(data) * 1000;
dispatchEvent(new DataAccessEvent(DataAccessor.INIT));
}
});
}, 500);
}
});
http://vkontakte.ru/apps.php?act=s&mid=1&id=2
[пруф]
Обсуждение можно почитать тут, спасибо XDiaBLo за находку.
http://flasher.ru/forum/showthread.php?t=139847
Запостил:
wvxvw,
12 Мая 2010
-
+6
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
if (event.customerName != "")
{
criteria.xmlCriteria =
"<criteria>" +
"<billingDetailsName>" + event.customerName + "</billingDetailsName>" +
"</criteria>";
}
else
{
criteria.xmlCriteria =
"<criteria>" +
"</criteria>";
}
Запостил:
voice,
12 Мая 2010
-
+4
- 1
- 2
- 3
...;
(button && button.timer ) ? b = ((button.timer.repeatCount - button.timer.currentCount) > 0) : b = true;
...;
а мне нравится, изящно так...
Запостил:
hman,
06 Мая 2010
-
+3
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
<mx:VBox xmlns:mx="...">
<mx:ComboBox ... />
<mx:Box width="{width}" height="100%">
<mx:DataGrid id="grid" dataProvider="{rawData}" height="100%"/>
</mx:Box>
</mx:VBox>
В гриде дохрена колонок. В таком манёвре горизонтальный скорлл есть, а до вертикального нужно "доскролить" горизонтальным.
Задача: сделать чтобы были видны оба.
Видимо горе девелопер сделал <mx:DataGrid id="grid" dataProvider="{rawData}" width="100%" height="100%"/> без Box-а... и взгруснул от ширины колонок. Ему, бедному, не пришло в голову что при 2х дюжинах колонок можно смело поставить horizontalScrollpolicy="on" и не городить огород (и не смешить общественность).
... ё-маё и это Сеньёр Флекс Девелопер.
Запостил:
dimas_art,
29 Апреля 2010