PDA

Просмотр полной версии : ИСХОДНИКИ [вопросы здесь не задаем, благодарность не выражаем]


BigDan
28.05.2006, 00:11
Исходники ActionScript 1.0/2.0
1.3D bukva m (http://flasher.ru/forum/attachment.php?attachmentid=14250&d=1148762107)
2.Animoushen vpered nazad (http://flasher.ru/forum/attachment.php?attachmentid=14251&d=1148762114)
3.Dvijenie rolika na mesto clica (http://flasher.ru/forum/attachment.php?attachmentid=14252&d=1148762135)
4.Gostevaa kniga (http://flasher.ru/forum/attachment.php?attachmentid=14253&d=1148762147)
5.Game Moonlander (http://flasher.ru/forum/attachment.php?attachmentid=14254&d=1148762189)
6.illuzia na 3D smail (http://flasher.ru/forum/attachment.php?attachmentid=14255&d=1148762452)
7.menu kontrollera (http://flasher.ru/forum/attachment.php?attachmentid=14256&d=1148762461)
8.mouse pokidaet raboshee pole (http://flasher.ru/forum/attachment.php?attachmentid=14257&d=1148762468)
9.povorot za kursorom (http://flasher.ru/forum/attachment.php?attachmentid=14258&d=1148762474)
10.primer pazzla (http://flasher.ru/forum/attachment.php?attachmentid=14259&d=1148762491)
11.Game worm (http://flasher.ru/forum/attachment.php?attachmentid=14260&d=1148762655)
12.primer localConnection (http://flasher.ru/forum/attachment.php?attachmentid=14261&d=1148762665)
13.primer menu (http://flasher.ru/forum/attachment.php?attachmentid=14262&d=1148762675)
14.primer polzunok (http://flasher.ru/forum/attachment.php?attachmentid=14263&d=1148762685)
15.primer SharedObject (http://flasher.ru/forum/attachment.php?attachmentid=14264&d=1148762692)
16.akrannaa klaviatura (http://flasher.ru/forum/attachment.php?attachmentid=14265&d=1148762951)
17.krugovia dvijenia poliarnie koordinaty (http://flasher.ru/forum/attachment.php?attachmentid=14266&d=1148762958)
18.primer raskraski (http://flasher.ru/forum/attachment.php?attachmentid=14267&d=1148762970)
19.programni obhot prepatstwia (http://flasher.ru/forum/attachment.php?attachmentid=14268&d=1148763016)
20.test (http://flasher.ru/forum/attachment.php?attachmentid=14269&d=1148763026)
21.effect Screenserver (http://flasher.ru/forum/attachment.php?attachmentid=14271&d=1148763217)
22.polzun (http://flasher.ru/forum/attachment.php?attachmentid=14272&d=1148763223)
23.risuem scriptom krug (http://flasher.ru/forum/attachment.php?attachmentid=14273&d=1148763234)
24.scroll (http://flasher.ru/forum/attachment.php?attachmentid=14274&d=1148763261)
25.dvijenie po parabole (http://flasher.ru/forum/attachment.php?attachmentid=14275&d=1148763318)
26.menu xml (http://flasher.ru/forum/attachment.php?attachmentid=14276&d=1148763506)
27.podshiniaem kadri kursoru (http://flasher.ru/forum/attachment.php?attachmentid=14277&d=1148763514)
28.poligon (http://flasher.ru/forum/attachment.php?attachmentid=14278&d=1148763530)
29.textura (http://flasher.ru/forum/attachment.php?attachmentid=14279&d=1148763555)
30.upravlenia color (http://flasher.ru/forum/attachment.php?attachmentid=14280&d=1148763563)
31.blur (http://flasher.ru/forum/attachment.php?attachmentid=14281&d=1148763692)
34.primer game ot D12 (http://flasher.ru/forum/attachment.php?attachmentid=14285&d=1148764459)
35.primerD12 (http://flasher.ru/forum/attachment.php?attachmentid=14381&d=1149452231)
36.RadiusText (http://flasher.ru/forum/attachment.php?attachmentid=14380&d=1149452184)
38.gallerea (http://flasher.ru/forum/attachment.php?attachmentid=14583&d=1151258266)
39.preloader (http://flasher.ru/forum/attachment.php?attachmentid=14626&d=1151687189)
40.linza (http://flasher.ru/forum/attachment.php?attachmentid=14676&d=1152213831)
41.player (http://flasher.ru/forum/attachment.php?attachmentid=15403&d=1160164529)
43.AsBroadcaster (http://flasher.ru/forum/attachment.php?attachmentid=15736&d=1163182568)
44.Color Change (http://flasher.ru/forum/attachment.php?attachmentid=15737&d=1163182576)
45.HitTest for 2 clip (http://flasher.ru/forum/attachment.php?attachmentid=15738&d=1163182585)
46.Move clip (http://flasher.ru/forum/attachment.php?attachmentid=15739&d=1163182597)
47.MovieClipLoader (http://flasher.ru/forum/attachment.php?attachmentid=15740&d=1163182736)
48.Right Click (http://flasher.ru/forum/attachment.php?attachmentid=15741&d=1163182819)
49.Plavnoe dviz (http://flasher.ru/forum/attachment.php?attachmentid=15742&d=1163182831)
50.LightPaint (http://flasher.ru/forum/attachment.php?attachmentid=15756&d=1163269433)
51.Pomehi (http://flasher.ru/forum/attachment.php?attachmentid=15757&d=1163269442)
52.FileWriter (http://flasher.ru/forum/attachment.php?attachmentid=15771&d=1163444019)
53.3D Piramida (http://flasher.ru/forum/attachment.php?attachmentid=15772&d=1163446906)
54.Sledi (http://flasher.ru/forum/attachment.php?attachmentid=15779&d=1163532401)
55.primer (http://flasher.ru/forum/attachment.php?attachmentid=15956&d=1165707681)
56.send&load (http://flasher.ru/forum/attachment.php?attachmentid=16076&d=1167223006)
57.airhokkey (http://flasher.ru/forum/attachment.php?attachmentid=16111&d=1167658441)
58.drugoe (http://flasher.ru/forum/attachment.php?attachmentid=16179&d=1168351335)
59.line (http://flasher.ru/forum/attachment.php?attachmentid=16937&d=1175676763)
60.class_zs (http://flasher.ru/forum/attachment.php?attachmentid=17085&d=1177248953)
61.simple_tip (http://flasher.ru/forum/attachment.php?attachmentid=17107&d=1177419491)
62.tip (http://flasher.ru/forum/attachment.php?attachmentid=17108&d=1177426040)
63.anti_mat (http://flasher.ru/forum/attachment.php?attachmentid=17109&d=1177443321)
64.cool_clock (http://flasher.ru/forum/attachment.php?attachmentid=17110&d=1177443340)
65.real_phisics_4kb (http://flasher.ru/forum/attachment.php?attachmentid=17111&d=1177443352)
66.textSearch_class (http://flasher.ru/forum/attachment.php?attachmentid=17112&d=1177443357)
67.crypt (http://flasher.ru/forum/attachment.php?attachmentid=17113&d=1177443470)
68.draw (http://flasher.ru/forum/attachment.php?attachmentid=17114&d=1177450831)
69.php_registr (http://flasher.ru/forum/attachment.php?attachmentid=17121&d=1177513574)
70.loader_as (http://flasher.ru/forum/attachment.php?attachmentid=17122&d=1177513592)
71.LoadVars+php+xml (http://flasher.ru/forum/attachment.php?attachmentid=17172&d=1178181814)
72.Paint (http://flasher.ru/forum/attachment.php?attachmentid=17224&d=1178641457)
73.Меню (http://www.flasher.ru/forum/showpost.php?p=652541&postcount=47)
74.Вращающее меню (http://www.flasher.ru/forum/showpost.php?p=658661&postcount=48)
75.разложение числа на простые множители (http://www.flasher.ru/forum/showpost.php?p=658670&postcount=49)
76.Добавка к mx.transitions, позволяет анимировать картинку из цветной к монохромной произвольного оттенка. (http://www.flasher.ru/forum/showpost.php?p=618020&postcount=34)
77.Класс, позволяющий на основе XML-файла, получить объект отражающий его структуру (http://www.flasher.ru/forum/attachment.php?attachmentid=17543&d=1188096598)
78.Класс содержит несколько функций для работы со стоками (http://www.flasher.ru/forum/attachment.php?attachmentid=17562&d=1188230236)
79.Вертикальное Меню (http://flashmenulabs.com/opensource)
80.Колебания, маятник (http://www.flasher.ru/forum/showpost.php?p=674309&postcount=52)
81.starClick5 (http://flasher.ru/forum/attachment.php?attachmentid=18060&d=1193303748)
Исходники ActionScript 3.0
1.Clock (http://flasher.ru/forum/attachment.php?attachmentid=16115&d=1167746531)
2.AddEventListener (http://flasher.ru/forum/attachment.php?attachmentid=16216&d=1168698122)
3.Attach MovieClip to Display (http://flasher.ru/forum/attachment.php?attachmentid=16217&d=1168698130)
4.My Event (http://flasher.ru/forum/attachment.php?attachmentid=16218&d=1168698155)
5.Working with keyboard (http://flasher.ru/forum/attachment.php?attachmentid=16219&d=1168698162)
6.Working with text (http://flasher.ru/forum/attachment.php?attachmentid=16220&d=1168698171)
7.RightDrag (http://flasher.ru/forum/attachment.php?attachmentid=16226&d=1168776586)
8.SimpleButton (http://flasher.ru/forum/attachment.php?attachmentid=16227&d=1168776600)
9.Using Filters (http://flasher.ru/forum/attachment.php?attachmentid=16228&d=1168776608)
10.DownloadManager (http://flasher.ru/forum/attachment.php?attachmentid=17217&d=1178612137)
11.ManyListeners (http://flasher.ru/forum/attachment.php?attachmentid=17218&d=1178612147)
12.Custom cursor + Directional Motion Blur (http://flasher.ru/forum/attachment.php?attachmentid=17952&d=1192471065)

Nirth
28.05.2006, 01:15
насчет имен исходников, у меня браузер\винды\флэш и вообще все английское, и лично у меня не открывается не исходник где в названии присутствует кирилица.

вот что пишут

! C:\Documents and Settings\David\My Documents\???????? ????????.zip: Cannot open C:\Documents and Settings\David\My Documents\???????? ????????.zip
The filename, directory name, or volume label syntax is incorrect.

dimel
16.06.2006, 10:32
искал везде таймер обратного отсчета, который показывал бы сколько месяцев, дней, часов и минут осталось до заданного события... не нашел... написал сам... (учтены все ньюансы)

KUZEN
16.06.2006, 12:23
Выкладывайте свои исходники. Только выкладывайте интересное. Пишите какое-то описание к вашим исходникам.
Пожалуйста, не выкладывайте всякую чушь.
Ты уже сам выложил кучу всякой чуши ...

xok
04.10.2006, 17:04
Данный калькулятор создавался для закрепления знаний и понимания AS, поэтому дизайн в калькуляторе отсутствует. Отличительной особенностью данного продукта является, то что цифры в дисплее калькулятора НАРИСОВАННЫЕ.
В калькуляторе реализованы функции сложения, вычитания, умножения, деления, извлечения квадратного корня, возведения в любую степень(ограничивается кол-вом цифр отображаемых на дисплее), функцией памяти.
Реализован режим горячих клавиш (клавиши Enter в калькуляторе клавиша "=" и клавиша Esc в калькуляторе клавиша "AС" работают только во встроенном редакторе flash).

Mr. Fixit
30.10.2006, 17:43
супер игра про ниндзю... зделано в Флеше.
Очень классно http://www.harveycartel.org/metanet/downloads.html

BigDan
10.11.2006, 22:19
......

BigDan
10.11.2006, 22:20
.........

BigDan
13.11.2006, 23:41
...............

NtM
09.12.2006, 10:19
Это к книге Бхангал Ш. Flash 8 Трюки
там есть пример переворачивания страниц, даже с теорией

http://examples.oreilly.com/flashhks/

Arhitector
20.12.2006, 12:09
Исходник пара
16031

CorC
27.12.2006, 16:38
пример использования LoadVars
сохранение в файл при помощи PHP
загрузка данных опять с LoadVars

BigDan
02.01.2007, 18:02
Исходник часов на АС3

LeXi42006
09.01.2007, 18:02
А вот простая рисовалка.

BigDan
13.01.2007, 18:23
Вот сделал небольшие исходники для начинающих в AS3

BigDan
14.01.2007, 16:10
Вот еще

wvxvw
04.03.2007, 17:23
Добавка к mx.transitions, позволяет анимировать картинку из цветной к монохромной произвольного оттенка.
/***********************************************************************
* SEPIA TRANSITION CLASS-FILE
* put this file into [Flas 8 folder]\en\First Run\Classes\mx\transitions
* restart Flash
* ----------------------------------------------------------------------
* SAMPLE USAGE:
* import mx.transitions.*;
* import mx.transitions.easing.*;
* TransitionManager.start([linkage to your MovieClip],
{type:Sepia,
direction:Transition.[IN or OUT],
duration:[seconds:Number],
easing:None.easeNone,
tint:[256 bit color:Number]});
* ----------------------------------------------------------------------
* © WVXVW
************************************************************************/
import mx.transitions.Transition;
import mx.transitions.TransitionManager;
import flash.filters.ColorMatrixFilter;
class mx.transitions.Sepia extends Transition {
#include "Version.as"
public var type:Object = Sepia;
public var className:String = "Sepia";
private var myColorMatrix_filter:ColorMatrixFilter;
private var __tgt:MovieClip;
private var __tint:Number = 0x000000;
private var __to:Object = {};
function Sepia(content:MovieClip, transParams:Object, manager:TransitionManager) {
this.init(content, transParams, manager);
}
function init(content:MovieClip, transParams:Object, manager:TransitionManager):Void {
super.init(content, transParams, manager);
this.myColorMatrix_filter = new ColorMatrixFilter();
this.__tgt = content;
this.__tint = transParams.tint;
this.__to = toRGB(this.__tint);
}
private function _render(p:Number):Void {
var rc:Number = 0.3086;
var gc:Number = 0.6094;
var bc:Number = 0.0820;
var myElements_array:Array = [1-p*(1-rc)+this.__to._r*p, p*gc, p*bc, 0, 0,
p*rc, 1-p*(1-gc)+this.__to._g*p, p*bc, 0, 0,
p*rc, p*gc, 1-p*(1-bc)+this.__to._b*p, 0, 0,
0, 0, 0, 1, 0];
this.myColorMatrix_filter = new ColorMatrixFilter(myElements_array);
this.__tgt.filters = [myColorMatrix_filter];
}
private function toRGB(_num:Number):Object {
var c_obj:Object = {_r:((_num >> 16) & 0xff)/255, _g:((_num >> 8) & 0xff)/255, _b:(_num & 0xff)/255};
return c_obj;
}
}

BigDan
26.03.2007, 22:31
В первом посте я собрал все исходники в одну кучу для удобства.

Sp1R1t
04.04.2007, 13:52
маленькое добавление к рисовалке
позволяет создавать прямые линии

goder
22.04.2007, 18:37
Небольшой класс для обмена через LoadVars
может кому понадобится
ногами не пинать за некоторые недоделки :)

ulik
24.04.2007, 17:58
Это просто стильная подсказка. Для тех, кто начинает учить flash.
Плюс ее в том, что она меняет свою ширину в зависимости от ширины текста. Просто и симпотно.
В *.fla пояснял каждую строку. Я думаю, любой начинающий поймет.
Вот собссссна...

MINASTIS
24.04.2007, 19:47
Обычная подсказка с гибким размером. Мой вариант.
Без комментариев в коде, но думаю все поймут.

ulik
25.04.2007, 00:38
textSearch_class.rar - учимся писать свои Классы
real_phisics_4kb.rar - как при помощи AS и 4 кб сделать реальнуб физику движения и нормальный хиттест (не используя hitTest естессно). Матаматика - сила.
anti_mat.rar - ищем матерные слова (даже сложные-составные) по корню слова из XML файла (например слово: ху*бл*ндия и т.д.)
cool_clock.rar - очередной подход к часикам. Есть замедление времени.
crypt.rar - шифруем данные побайтным сдвигом по ключевому слову (шоб никто не узнал че пишем :))

Качаем. Смотрим. Учим. :umnik2:

зы: real_phisics - в нем не дописан хиттест снизу поверхностей. Извините - дел по горло. Я думаю, не сложно будет дописать, поняв принцип. Главное - y=kx+b

ulik
25.04.2007, 02:40
Вот еще. Простая рисовалочка с функцией Replay (как только нарисуетесь, нажмите пробел он же "SPACE").:bye:

MINASTIS
25.04.2007, 20:06
php_registr.rar - регистрация и вход пользователя во флеш используя mySQL, php скрипт и конечно as. Для работы нужен виртуальный сервер с поддержкой php и чтобы была mySQL. Скрин для настройки таблицы mySQL прилагается. Скрипт php по взаимодействию с базой с комментариями. :bye:

loader_as.rar - полностью программный прелоадер, не используя никаких инструментов рисования. Просто поставь посередине первого кадра :)

BigDan
29.04.2007, 16:16
Когда выкладываете исходник, указывайте к какому разделу(AS2/AS1,AS3) он относится.

CorC
03.05.2007, 13:44
Улучшение по LoadVars:
Считываение из текстового поля, передача в php,
запись в xml и вывод обратно данных из php и xml.

BigDan
08.05.2007, 13:15
1.DownloadManager - пример елементарного мастера загрузок.
2.ManyListeners - ответ на вопрос "Что мне делать, когда много конопок и для каждой нужен обработчик?"

denself
08.05.2007, 21:29
Посмотрите, скачайте...

Kikasso
08.07.2007, 04:13
Математика: разложение числа на простые множители.
Stage.align = 'TL';
mess_txt = createTextField("mess_txt", 0, 2, 2, 300, 20 );
mess_txt.autoSize = 'left';
mess_txt.text = 'Введите число и нажмите на кнопку. 15 знаков максимум.';

num_txt = createTextField("num_txt", 1, 4, 24, 200, 20 );
num_txt.type = 'input'; num_txt.restrict = "0-9"; num_txt.border = true;

time_txt = createTextField("time_txt", 2, 4, 46, 200, 20 );
time_txt.autoSize = "left";

rez_txt = createTextField("rez_txt", 3, 4, 68, 200, 20 );
rez_txt.autoSize = "left"; rez_txt.multiline = true;

b_txt = createTextField("num_txt", 4, 212, 24, 100, 20 );
b_txt.html = true;
b_txt.htmlText = "<b><a href='asfunction:acceptAndCalculate' >[ CALCULATE ]</a> </b>";

function acceptAndCalculate():Void{
if(num_txt.text.length > 15){
rez_txt.text = ' (( number too big only 15 digits plz )) ';
return;
}
var n:Number = Number(num_txt.text);
if(isNaN(n)){
rez_txt.text = ' (( enter number )) ';
return;
}
var t:Number = getTimer();
rez_txt.text = String(n)+' =\n'+findEm(n).join('*');
time_txt.text = 'calculated in '+ String(getTimer() - t) + 'ms';
}
function findEm( num:Number ):Array{
var arr:Array = [];
var k:Number = 2;
while( true ){
if( k*k > num ){
arr.push( num );
break;
}
if( num % k == 0 ){
arr.push(k);
num /= k;
continue;
}
k++;
}
trace(arr);
return arr;
}

Ляксей
31.08.2007, 12:02
Open Source проект от Flash Menu Labs
Вертикальное Меню (http://flashmenulabs.com/opensource)
структура и настройки читаются из XML
графика и анимация задаётся во fla-файле

kim2
15.10.2007, 23:04
Назначается произвольный курсор c эффектом размытия при движении.
Как известно эффект размытия во flash действует только вдоль оси x или y и не подвержен повороту на какой-либо угол, в этом примере обходится этот недочет. Реализован на AS3

Kikasso
25.10.2007, 14:18
Водим мышкой.

wvxvw
22.11.2007, 18:41
import mx.transitions.Transition;
import mx.transitions.TransitionManager;

class mx.transitions.Iris extends Transition {

#include "Version.as"

public static var SQUARE:String = "SQUARE";
public static var CIRCLE:String = "CIRCLE";
public static var HEART:String = "HEART";
public static var STAR:String = "STAR";

public var type:Object = Iris;
public var className:String = "Iris";

private var _mask:MovieClip;
private var _startPoint:Number = 5;
private var _cornerMode:Boolean;
private var _shape:String = "CIRCLE";
private var _rays:Number = 5;
private var _maxDimension:Number;
private var _minDimension:Number;
private var _renderShape:Function;

function Iris (content:MovieClip, transParams:Object, manager:TransitionManager) {
this.init (content, transParams, manager);
};

function init (content:MovieClip, transParams:Object, manager:TransitionManager):Void {
//trace ("Iris.init()");
super.init (content, transParams, manager);
if (transParams.startPoint) {this._startPoint = transParams.startPoint};
if(transParams.shape.length) this._shape = transParams.shape;
if(!isNaN(transParams.rays)) this._rays = transParams.rays;
this._maxDimension = Math.max (this._width, this._height);
this._minDimension = Math.min (this._width, this._height);


// if _startPoint is an odd number, it's a corner
if (this._startPoint % 2) {
this._cornerMode = true;
}
// assign the render function dynamically based on shape choice
if (this._shape == "SQUARE") {
if (this._cornerMode) {
this._render = this._renderSquareCorner;
} else {
this._render = this._renderSquareEdge;
}
} else if (this._shape == "CIRCLE") {
this._render = this._renderCircle;
} else if (this._shape == "HEART"){
this._render = this._renderHeart;
} else if (this._shape == "STAR"){
this._render = this._renderStar;
}

this._initMask();
};

function start ():Void {
this._content.setMask (this._mask);
super.start();
}

function cleanUp ():Void {
this._mask.removeMovieClip();
super.cleanUp();
}


private function _initMask ():Void {
var container:MovieClip = this._content;
var depth:Number = this.getNextHighestDepthMC (container);

var mask:MovieClip = this._mask = container.createEmptyMovieClip ("__mask_Iris_"+this.direction, depth);
//mask._alpha = 30;
mask._visible = false;
var ib:Object = this._innerBounds;

switch (this._startPoint) {
case 1:
// top left
mask._x = ib.xMin;
mask._y = ib.yMin;
break;
case 4:
// left
mask._x = ib.xMin;
mask._y = (ib.yMin + ib.yMax) * .5;
break;
case 3:
// top right
mask._rotation = 90;
mask._x = ib.xMax;
mask._y = ib.yMin;
break;
case 2:
// top center
mask._rotation = 90;
mask._x = (ib.xMin + ib.xMax) * .5;
mask._y = ib.yMin;
break;
case 9:
// bottom right
mask._rotation = 180;
mask._x = ib.xMax;
mask._y = ib.yMax;
break;
case 6:
// right
mask._rotation = 180;
mask._x = ib.xMax;
mask._y = (ib.yMin + ib.yMax) * .5;
break;
case 7:
// bottom left
mask._rotation = -90;
mask._x = ib.xMin;
mask._y = ib.yMax;
break;
case 8:
// bottom center
mask._rotation = -90;
mask._x = (ib.xMin + ib.xMax) * .5;
mask._y = ib.yMax;
break;
case 5:
// center
mask._x = (ib.xMin + ib.xMax) * .5;
mask._y = (ib.yMin + ib.yMax) * .5;
break;
default:
break;
}
}

// stub--dynamically overwritten by one of the other render methods
private function _render (p:Number):Void {}


private function _renderCircle (p:Number):Void {
var mask:MovieClip = this._mask;
mask.clear();
mask.beginFill (0xFF0000);

if (this._startPoint == 5) {
// iris from center
var maxRadius:Number = .5 * Math.sqrt (this._width*this._width + this._height*this._height);
this.drawCircle (mask, 0, 0, p*maxRadius);
} else {
if (this._cornerMode) {
// iris from corner
var maxRadius:Number = Math.sqrt (this._width*this._width + this._height*this._height);
this._drawQuarterCircle (mask, p*maxRadius);
} else {
// iris from edge
if (this._startPoint == 4 || this._startPoint == 6) {
// half-circle from left or right edge
var maxRadius:Number = Math.sqrt (this._width*this._width + .25*this._height*this._height);
} else if (this._startPoint == 2 || this._startPoint == 8) {
// half-circle from top or bottom edge
var maxRadius:Number = Math.sqrt (.25*this._width*this._width + this._height*this._height);
}
this._drawHalfCircle (mask, p*maxRadius);
}
}
mask.endFill();
}

private function _drawQuarterCircle (mc:MovieClip, r:Number):Void {
var x=0, y=0;
mc.lineTo (r, 0);
mc.curveTo (r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
mc.curveTo (Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
}

private function _drawHalfCircle (mc:MovieClip, r:Number):Void {
var x=0, y=0;
mc.lineTo (0, -r);
mc.curveTo (Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
mc.curveTo (r+x, -Math.tan(Math.PI/8)*r+y, r+x, y);
mc.curveTo (r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
mc.curveTo (Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
mc.lineTo (0, 0);
}

//this._maxDimension = Math.max (this._width, this._height);

private function _renderSquareEdge (p:Number):Void {
var mask = this._mask;
mask.clear();
mask.beginFill (0xFF0000);
var s = this._startPoint;
var w = p*this._width;
var h = p*this._height;
var z = p*this._maxDimension;
if(s == 4 || s == 6){
this.drawBox (mask, 0, -.5*h, w, h);
}else if(this._height < this._width){
this.drawBox (mask, 0, -.5*z, h, w);
}else{
this.drawBox (mask, 0, -.5*z, z, z);
}
mask.endFill();
}

private function _renderHeart(p:Number):Void {
var d:Number = Math.min(this._width,this._height)*p;
var k:Number = -d/2;
var mask = this._mask;
mask.clear();
mask.beginFill (0xFF0000);
mask.moveTo(k,k+d/4);
mask.curveTo(k,k,k+d/4,k);
mask.curveTo(k+d/2,k,k+d/2,k+d/4);
mask.curveTo(k+d/2,k,k+d*3/4,k);
mask.curveTo(k+d,k,k+d,k+d/4);
mask.curveTo(k+d,k+d/2,k+d*3/4,k+d*3/4);
mask.lineTo(k+d/2,k+d);
mask.lineTo(k+d/4,k+d*3/4);
mask.curveTo(k,k+d/2,k,k+d/4);
mask.endFill();
}

private function _renderStar(p:Number):Void {
var d:Number = Math.min(this._width,this._height)*p;
var s:Number = Math.PI*2/this._rays;
var mask = this._mask;
mask.clear();
mask.beginFill(0xFF0000);
mask.moveTo(0,d/2);
for(var i:Number=0; i<this._rays; i++){
mask.lineTo(d*.5*Math.sin(s*i),d*.5*Math.cos(s*i));
mask.lineTo(d*Math.sin(s*(i+.5)),d*Math.cos(s*(i+.5)));
}
mask.endFill();
}

private function _renderSquareCorner (p:Number):Void {
var mask = this._mask;
mask.clear();
mask.beginFill (0xFF0000);
var s = this._startPoint;
var w = p*this._width;
var h = p*this._height;
if (s == 5) {
this.drawBox (mask, -.5*w, -.5*h, w, h);
}else if(s == 3 || s == 7){
this.drawBox (mask, 0, 0, h, w);
} else {
this.drawBox (mask, 0, 0, w, h);
}
mask.endFill();
}
} Немного измененный код эффекта "Айрис" (добавлены варианты "Звезда" и "Сердце" %) Мож кому пригодится )

ulik
12.12.2007, 18:07
Вот решил сделать шифратор/дешифратор. Кто-то просил.
Все удовольсвие - 11 строк кода.
Шифрует / дешифрует данные. Зашифрованный текст можно вставить, скажем в новый txt файл, сохранить в режиме UTF-8 !!!! и отправить, знакомому агенту :)))):victory:

Кодируем.... (http://flasher.ru/forum/attachment.php?attachmentid=18457&stc=1&d=1197468320)

f3ath
25.12.2007, 10:44
Tooltip, он же Hint, он же всплывающая подсказка, на AS 2.0. Рабочий вариант класса, который использован мной в готовом приложении. Выкладываю as is, кому нужно, тот разберется.


class Tooltip
{
private var clientList:Array;
private var currentHintIndex;
private var globalMovieClip; // movieClip to get mouse coordinates from, usually _root?

private var xMouseValue, yMouseValue:Number;
private var delayCounter:Number;

private var hitTestCalled:Boolean;

public static var interval:Number = 50; // ticks interval in millisec
public static var delay:Number = 700; // delay mouse stops and before hint shown
public static var movieClipName; // movieclip himself

private var hint;

public function Tooltip()
{
clientList = [];
globalMovieClip = _root;
xMouseValue = globalMovieClip._Xmouse;
yMouseValue = globalMovieClip._Ymouse;
delayCounter = 0;
hitTestCalled = false;
setInterval(this, 'tick', interval);
}

public function tick()
{
if((xMouseValue == globalMovieClip._Xmouse) && (yMouseValue == globalMovieClip._Ymouse))
{
delayCounter += Tooltip.interval;
if(delayCounter >= Tooltip.delay)
{
if(!hitTestCalled) doHitTest();
hitTestCalled = true;
};
}
else
{
hitTestCalled = false;
delayCounter = 0;
hideCurrent();
}

xMouseValue = globalMovieClip._Xmouse;
yMouseValue = globalMovieClip._Ymouse;

}
private function showHint(i)
{
currentHintIndex = i;
if(!clientList[i].txt) return;
hint = mx.managers.DepthManager.createObjectAtDepth('HintMovieClip', mx.managers.DepthManager.kTooltip);
hint.txt.text = clientList[i].txt;
hint._x = globalMovieClip._Xmouse + 10;
hint._y = globalMovieClip._Ymouse + 10;
hint.setDepthTo(mx.managers.DepthManager.kTooltip);
}

private function hideHint(i)
{
currentHintIndex = undefined;
hint.removeMovieClip();
}

private function hideCurrent()
{
if(undefined == currentHintIndex) return;
hideHint(currentHintIndex);
}

private function doHitTest()
{

var mc = getTopmostVisibleMC(_root._Xmouse, _root._Ymouse, _root);
//trace('topmost='+mc);
var index = clientList.getIndexByProp('mc', mc)


if(undefined != index)
{
showHint(index);
}
else
{
sweep(); //while we're in idle
}
}

public function registerClient(mc, txt:String)
{
var i = clientList.getIndexByProp('mc', mc);
if(undefined == i)
{
clientList.push({mc:mc, txt:txt});
}
else
{
clientList[i].txt = txt;
}
}

public function removeClient(mc)
{
var i = clientList.getIndexByProp('mc', mc);
if(undefined == 1) return;
clientList.splice(i, 1);
}

public function sweep()
{
var sweepedList:Array = [];
for(var i:Number = 0; i < clientList.length; i++)
{
if(clientList[i].mc) sweepedList.push(clientList[i]);
}
clientList = sweepedList;
}

public function get length():Number
{
return clientList.length;
}

private function getTopmostVisibleMC(x, y, papa)
{
var candidate = undefined;

for(var foo in papa)
{
if('movieclip' == typeof(papa[foo]))
{
if(!candidate && papa[foo]._visible)
{
if(papa[foo].hitTest(x, y, true)) candidate = papa[foo];
}
else
{
if((candidate.getDepth() < papa[foo].getDepth()))
{
if(papa[foo]._visible && papa[foo].hitTest(x, y, true))
{
candidate = papa[foo];
//trace('ht='+candidate+'@'+candidate.getDepth());
}
}
}
}
}
return candidate;
}

}

f3ath
25.12.2007, 10:54
Итератор как в php5

Интерфейс:

interface Iterator // this is interface actually, identical to PHP5 iterator
{
// Returns the current value
public function current();

// Returns the current key
public function key();

// Moves the internal pointer to the next element
public function next():Void

// Moves the internal pointer to the first element
public function rewind():Void;

// If the current element is valid (boolean)
public function valid():Boolean;
}


Итератор для массива

class ArrayIterator implements Iterator
{
private var p:Number;
private var a:Array;

public function ArrayIterator(arr)
{
this.a = arr;
this.p = 0;
}

// Returns the current value
public function current()
{
return a[p];
}


// Returns the current key
public function key()
{
return p;
}

// Moves the internal pointer to the next element
public function next():Void
{
this.p++;
}

// Moves the internal pointer to the previuos element
public function prev():Void
{
this.p--;
}


// Moves the internal pointer to the first element
public function rewind():Void
{
this.p = 0;
}

// Moves the internal pointer to the last element
public function ff():Void
{
this.p = (this.a.length - 1) ;
}

// If the current element is valid (boolean)
public function valid():Boolean
{
return Boolean(this.p < this.a.length);
}
}

f3ath
25.12.2007, 10:56
Фабрика

class Factory
/*
Factory class

example:

//create factory object for class myClass
// myClass.id - unique identifier of myClass instances
var myFactory = Factory.getFactoryFor('myClass', 'id');

//create myClass object
var myObject = myFactory.create(123);
// myObject is now instance of myClass
// myObject.id == 123

var myObject1 = myFactory.create(123);
// myObject1 is alias of myObject
// myObject1.id == myObject.id == 123

var myObject2 = myFactory.create(321);
// myObject2.id = 321
// myObject2 != myObject1
*/
{
var className:String;
var idName:String;
var cache:Array;
static var selfCache:Array;

private function Factory(className:String, idName:String)
{
this.className = className;
this.idName = idName;
this.cache = new Array;
};

public static function getFactoryFor(className:String, idName:String)
{
if(!selfCache[className])
{
if(!selfCache) selfCache = new Array;
selfCache[className] = new Factory(className, idName);
if(!selfCache[className]) trace('ERROR: can not create Factory');
}
return selfCache[className];
}

private function safeNew(className)
{
var obj = new [className]; // create object
if(!obj) trace("ERROR: can not instantiate '"+className+"' object"); // error
return obj;
}

public function create(initData)
{
var obj:Object;
if(this.idName) // id field specified
{// use cache
if(this.cache[initData[this.idName]]) // found in cache
{ // return cached object
return this.cache[initData[this.idName]];
}
else
{ // create instance
this.cache[initData[this.idName]] = this.safeNew(this.className); // save in cache
};
obj = this.cache[initData[this.idName]];
}
else // id field not specified
{ // no cache
obj = this.safeNew(this.className);
};
var foo:String; // iterator
for(foo in initData)
{
obj[foo] = initData[foo]; // assign property
};
return obj;
}
}

D12
02.03.2008, 03:50
18949
swf-ссылка для просмотра: Meny (http://goroskop.110mb.com/index1.html)

D12
19.03.2008, 00:45
19102
swf-ссылка для просмотра:swf (http://goroskop.110mb.com/index2.html)
Присутствует два эффекта отображения

Alex Lexcuk
03.05.2008, 00:59
замена кровня клипов
http://www.free-lance.ru/users/BasCPP/upload/f_47e275cb780f2.swf

пример скроллера
http://kind-armadillo.pochta.ru/fla/classbut_scrol.swf
http://kind-armadillo.pochta.ru/fla/classbut_scrol.rar

пример нажатия на клипаки
http://kind-armadillo.pochta.ru/fla/on_press.rar
http://kind-armadillo.pochta.ru/fla/on_press.swf

Вращение машинки
http://kind-armadillo.pochta.ru/fla/car_rotation.swf
http://kind-armadillo.pochta.ru/fla/car_rotation.rar

загрузка звука
http://kind-armadillo.pochta.ru/fla/stop_sound.swf
http://kind-armadillo.pochta.ru/fla/stop_sound.zip
модифицированный с прелодырем
http://kind-armadillo.pochta.ru/fla/pre_load_sound.swf
http://kind-armadillo.pochta.ru/fla/preload_stop_sound.rar

Собака
http://kind-armadillo.pochta.ru/DOG5_1.swf
http://kind-armadillo.pochta.ru/Snow_dog.swf

Загрузка переменных АС2
http://kind-armadillo.pochta.ru/fla/load_mont.fla
http://kind-armadillo.pochta.ru/fla/load_mont.swf

счетчик
http://dnadillo.dn.ua/php_flash/classbut/count_attendance.swf
http://dnadillo.dn.ua/php_flash/php_flash.zip

Флеш дождь
http://murmadillo.tut.su/rain.swf
http://murmadillo.tut.su/fla/rain.zip
http://murmadillo.tut.su/fla/rain_tween.zip

Флешка со счетчиком посещаемости
http://murmadillo.tut.su/php_flash/page_0.html

Alex Lexcuk
03.05.2008, 01:02
Обучающая флеш игра
http://dnadillo.dn.ua/session_set.php
http://kind-armadillo.pochta.ru/fla/game_Alex_Lexcuk.rar

Alex Lexcuk
28.08.2008, 20:09
Идея была такая: загнать маленькую swf в блог
и пользователи могут там, что нибуть нарисовать, затем нажать кнопку [code] потом [copy to clipboard] и теперь надо вставить в комменты нажатием клавиш ctrl+v не очень длинный код рисунка, при нажатии во флешке клавиши find, она считает в себя эту страницу
http://www.free-lance.ru/blogs/view.php?tr=262671&ord=new
и найдет свои рисунки, которые отобразятся с текстовой области в виде ссылок, их можно нажимать и просматривать все рисунки, которые нарисовали пользователи.
Использовались регулярные выражения
http://www.flasher.ru/forum/attachment.php?attachmentid=20277&stc=1&d=1219935708

AlexCooper
19.10.2008, 01:50
MD5 на AS2

NeverSummer
25.10.2008, 04:40
Вот!!! Наконец то я постю свой первый исходник. Приятно когда ты можешь не только спрашивать, но что то и дать - может пригодится кому. :yahoo:
Смысл - заставка/галерейка. При нажатии снизу на тхумбнейл показывается картинка соответствующая тхумбнейлу и меню из тхумбнейлов внизу перестраивается динамически так что бы показывать все тхумбнейлы кроме того который соответствует показываемой картинке. Наверноя немного путанно изложил .. НО скачайте исходник - скомпилите и запустите - сразу станет понятно. Вообщем буду рад если кому то поможет.

3o3o
28.10.2008, 20:18
простенький дым и молния

молния генерится из левого верхнего угла в точку клика, держится пока зажата ЛКМ, настроена под клик в районе правого нижнего угла.

вся графика (кроме черного фона у молнии) программная.

flashbox
14.11.2009, 11:34
сами увидите что это;)

Не пожалеете, присоединяйтесь ко мне , заходите на флешдэн
Это интернет магазин флеш приложений (можно продавать свои работы)
русских я там не находил( поэтому мне одному там скучно...

http://activeden.net

я "I-flash"



Вот одна из моих работ:

monadya
28.11.2009, 01:47
подскажите, пожалуйста, где найти движок такого типа, как на сайте http://www.soft.se/#index???

waror
28.12.2009, 15:50
Мп3 плеер (http://web-silver.ru/flash/source/download/sound/mp3Player.zip)

temofony
10.02.2010, 19:16
создатель ты хоть читал че за бред написан в readme в исходнике send&load??и как это заставить работать??

Fidelin
19.05.2010, 01:25
:) энтузиасты! я не закончил Мортал Комбат.может кто доделает?!
shift - удар ногой, space - рукой, shift+space - куски льда.
работает прыжок + есть соперник 24432

KirillWd
24.07.2010, 23:20
электронные часы!
показывают час, минуту. число/месяц | год | день недели!

http://s57.***********/i158/1007/6a/10bdaa132a20.png

Крот
25.10.2010, 23:40
Всплывающая подсказка на AS3. За основу взят другой исходник (http://flasher.ru/forum/attachment.php?attachmentid=17107&d=1177419491). Но отличием является то, что мой вариант подходит для многострочных подсказок.

Возможно кому-то будет полезен. Оригинал на AS1 мне в свое время помог. И конечно его можно и улучшить, но это уже будет полезно конечному пользователю.

Код с комментариями.

Hauts
30.04.2011, 16:56
Примеры инерционного скроллбара и кода для определения пересечения сложных геометрических фигур. as2.

Lyso
10.06.2011, 21:54
Решил изменить исходник
43.AsBroadcaster //ActionScript 2.0

На ActioNScript 3.0.

Вот так получилось...

Lyso
11.06.2011, 10:12
Решил изменить исходник
44.Color Change //ActionScript 2.0

На ActioNScript 3.0.

Вот так получилось...

Lyso
11.06.2011, 13:14
Решил изменить исходник as2 на as3 под номером 46.
46.Move clip

Вот, что у меня получилось:

Lyso
12.06.2011, 20:47
Всплывающая подсказка. Появляется при наведении и ожидании 1,6 секунд. Сама подсказка, как и ее блок расширяется в зависимости от текста. Так же "несколькострочна". ActioNScript 3.0.
Код в отдельном документе.