Нашли или выдавили из себя код, который нельзя назвать нормальным,
на который без улыбки не взглянешь?
Не торопитесь его удалять или рефакторить, — запостите его на
говнокод.ру, посмеёмся вместе!
if ((m_window.popupBox_mc.popupBox_tf.text == "Пожалуйста обратитесь в службу поддержки и опишите действия после которых возникла ошибка. Затем обновите страницу.")||(m_window.popupBox_mc.popupBox_tf.text == "Ошибка ресурсов сервера. Пожалуйста обратитесь в службу поддержки и опишите действия после которых возникла ошибка. Затем обновите страницу.")||(m_window.popupBox_mc.popupBox_tf.text == "Ты запустил игру в двух браузерах или окнах одновременно. Закрой одно из окон и обнови страницу!")||(m_window.popupBox_mc.popupBox_tf.text == GlobalEngine.quickLocalize("FarmGame", "ServerError"))||(m_window.popupBox_mc.popupBox_tf.text == GlobalEngine.quickLocalize("FarmGame", "RefreshGame")))
{
m_window.popupBox_mc.accept_bt.visible = false;
}
public function addItem(obj):void
{
if(obj is DisplayObject)
{
objectArray.push(obj);
}
else
{
throw new Error("Cannot add item: " + obj + " - item must be a Display Object.");
}
}
static public function getCamera():Camera
{
// Return the same camera if it has been successfully requested before
if (cam != null)
{
if (cam.muted) Security.showSettings(SecurityPanel.PRIVACY);
return cam;
}
// Get the camera
cam = Camera.getCamera();
if (cam != null)
{
// Set properties if a camera was found
if((cam.name.toLowerCase().indexOf("usb") != -1) &&
(flash.system.Capabilities.os.toLowerCase().indexOf("mac") != -1))
{
// this is a mac default cam, dont change mode
Logger.getInstance().debug("has usb + mac: no set mode");
}
else
{
cam.setMode(CAMERA_WIDTH, CAMERA_HEIGHT, 30, true);
Logger.getInstance().debug("setMode to cam");
}
cam.addEventListener(StatusEvent.STATUS, NeaveCamera.statusListener);
return cam;
}
else
{
// No camera found
Security.showSettings(SecurityPanel.CAMERA);
return new Camera();
}
}
var p2pStream:P2PStream = this
var client:Object = new Object();
client.onPeerConnect = function(subscriber:NetStream):Boolean{
return p2pStream.onPeerConnect()}
nsPublish = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
nsPublish.client = client;
Это AS3 (хотя это было бы говном в AS2 тоже, но там хоть причину можно было понять).
/**
* @private
* The exponent used in the easer function for the main part of the throw animation.
* NOTE: if you change this, you need to re-differentiate the easer
* function and use the resulting derivative calculation in createThrowMotionPath.
*/
private static const THROW_CURVE_EXPONENT:Number = 3.0;
...
// Set the velocity for the next loop iteration. Make sure it matches the actual velocity in effect when the
// throw reaches the end of the list.
//
// The easer function we use for the throw is 1-((1-x)^3), the derivative of which is 3*x^2-6*x+3.
// (I used http://www.numberempire.com/derivatives.php to differentiate the easer function).
// Since the slope of a curve function at any point x (i.e. f(x)) is the value of the derivative at x (i.e. f'(x)),
// we can use this to determine the velocity of the throw at the point it reached the beginning of the bounce.
var x:Number = partialTime / effectTime;
var y:Number = 3 * Math.pow(x, 2) - 6 * x + 3;
Flex 4.5 Hero.
Благо на работу кода это не сказывается, но всё-таки...
Разработчикам: Вообще класс и непосредственно алгоритм touch/kinetic скролла там сделан отвратительно, но с некоторыми весьма хорошими фишками (отпределение скорости, например). Советую вам покопаться.