Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Сообщения за день
 

Вернуться   Форум Flasher.ru > Flash > ActionScript 1.0/2.0

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 21.08.2007, 11:49
telit вне форума Посмотреть профиль Отправить личное сообщение для telit Найти все сообщения от telit
  № 1  
Ответить с цитированием
telit
 
Аватар для telit

Регистрация: Jul 2007
Сообщений: 306
Question копия movieClipa

Код:
_root.createEmptyMovieClip("menu_mc", _root.getNextHighestDepth());
_root["menu_mc"].createEmptyMovieClip("mc_2", _root["menu_mc"].getNextHighestDepth());
_root["menu_mc"]["mc_2"].loadMovie("hair.swf");
_root["menu_mc"].createEmptyMovieClip("mc_1", _root["menu_mc"].getNextHighestDepth());

with (_root["menu_mc"]["mc_1"]){
    lineStyle(1, 0xCCCCCC);
    beginFill(0x4827CF);
    moveTo(0, 0);
    lineTo(80, 0);
    lineTo(80, 60);
    lineTo(0, 60);
    lineTo(0, 0);
    endFill();
}
    
_root["menu_mc"]["mc_1"].onPress = function() { 
   dup(this);
}

_root["menu_mc"]["mc_1"].onRelease = _root["menu_mc"]["mc_1"].onReleaseOutside = function() { 
removeMovieClip(f_mc);
}

dup = function(m_mc:MovieClip){
	duplicateMovieClip(m_mc, "f_mc", _root.getNextHighestDepth());
	f_mc.startDrag();
	trace(_root["f_mc"]);//undefined
	trace(f_mc);//undefined
}
почему не работает?
PS все делать в _root не предлагать

Старый 21.08.2007, 12:32
KPOT вне форума Посмотреть профиль Отправить личное сообщение для KPOT Найти все сообщения от KPOT
  № 2  
Ответить с цитированием
KPOT
[+1.3 31.07.07]
 
Аватар для KPOT

Регистрация: Jul 2007
Сообщений: 64
Код:
this.createEmptyMovieClip("menu_mc", this.getNextHighestDepth());
this["menu_mc"].createEmptyMovieClip("mc_2", this["menu_mc"].getNextHighestDepth());
this["menu_mc"]["mc_2"].loadMovie("hair.swf");
this["menu_mc"].createEmptyMovieClip("mc_1", this["menu_mc"].getNextHighestDepth());

with (this["menu_mc"]["mc_1"]){
    lineStyle(1, 0xCCCCCC);
    beginFill(0x4827CF);
    moveTo(0, 0);
    lineTo(80, 0);
    lineTo(80, 60);
    lineTo(0, 60);
    lineTo(0, 0);
    endFill();
}
    
this["menu_mc"]["mc_1"].onPress = processPressClip;

this["menu_mc"]["mc_1"].onRelease = this["menu_mc"]["mc_1"].onReleaseOutside = function() 
{ 
//removeMovieClip(this);
}

var currentTarget:MovieClip;

function dup(m_mc:MovieClip)
{
	var nextDepth:Number = this["menu_mc"].getNextHighestDepth();
	m_mc.duplicateMovieClip("f_mc"+nextDepth, nextDepth);
	
	var duppedClip:MovieClip = this["menu_mc"]["f_mc"+nextDepth];
	
	currentTarget = duppedClip;
	
	duppedClip.onPress = processPressClip;
	duppedClip.onRelease = processReleaseClip;
	
	duppedClip.startDrag();
}

this.onMouseUp = function()
{
	if(currentTarget != null)
	
	currentTarget.stopDrag();
	currentTarget = null;
}

function processReleaseClip()
{
	this.stopDrag();	
}

function processPressClip()
{
	this._parent._parent.dup(this);
}
немного модифицировал, думаю разберёшся что к чему

Старый 21.08.2007, 16:42
telit вне форума Посмотреть профиль Отправить личное сообщение для telit Найти все сообщения от telit
  № 3  
Ответить с цитированием
telit
 
Аватар для telit

Регистрация: Jul 2007
Сообщений: 306
Код:
function thumbnails_fn_r(kr) {
	r_menu.createEmptyMovieClip("t"+kr, r_menu.getNextHighestDepth());
	tlistener_r = new Object();
	tlistener_r.onLoadInit = function(target_mc_r) {
		if ((kr%2)!=0) {
		target_mc_r._y = hit_top._y+(128-60)*(kr-1);
		target_mc_r._x = 140;
		} else {
			target_mc_r._y = hit_top._y+(128-60)*kr;
		}
		target_mc_r._xscale = target_mc_r._yscale = 50;
		target_mc_r.pictureValue_r = kr;
		
		target_mc_r.onRollOver = function() {
			this._alpha = 50;
			//if (_root.flagPress == 0)
			thumbNailScroller_r();
		};
		target_mc_r.onRollOut = function() {
			this._alpha = 100;
		};
		
		target_mc_r.onPress = processPressClip;
	};
	image_mcl_r = new MovieClipLoader();
	image_mcl_r.addListener(tlistener_r);
	image_mcl_r.loadClip(thumbnails_r[kr], "r_menu.t"+kr);
}



var currentTarget:MovieClip;

function dup(m_mc:MovieClip)
{
	var nextDepth:Number = _root.r_menu.getNextHighestDepth();
	m_mc.duplicateMovieClip("f_mc"+nextDepth, nextDepth);
	
	var duppedClip:MovieClip = _root.r_menu["f_mc"+nextDepth];
	
	currentTarget = duppedClip;
	
	duppedClip.onPress = processPressClip;
	duppedClip.onRelease = processReleaseClip;
	
	duppedClip.startDrag();
}

this.onMouseUp = function()
{
	if(currentTarget != null)
	{
	currentTarget.stopDrag();
	if (currentTarget.hitTest(_root.box)) trace("good");
	}
	//trace(currentTarget);
	removeMovieClip(currentTarget);
	currentTarget = null;
}

function processReleaseClip()
{
	this.stopDrag();	
}

function processPressClip()
{
	this._parent._parent.dup(this);
}
как исправить?

Создать новую тему Ответ Часовой пояс GMT +4, время: 15:57.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 15:57.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.