problem se skryptem

Technologia Flash, czyli animacja na potrzeby stron WWW to świat daleko odbiegły od zwykłego programowania i kodu. Zapytaj o pomoc i podziel się z nami Twoimi problemami z zakresu Flasha.
kkemot
Posty: 1
Rejestracja: pn lis 02, 2009 10:21 pm

problem se skryptem

Post autor: kkemot »

mam prosbe mam gotowy skrypt galerii we flashu i chcialbym aby po kliknieciu danej miniaturki wyswietlalo np pole z jakims tekstem obok na tej samej stronie a nie w nowym oknie oraz zeby menu nie znikalo tylko wciaz bylo widoczne i nie potrafie przerobic skryptu prosze o pomoc jestem totalnym nowicjuszem ponizej wklejam kod
:

Kod: Zaznacz cały

stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;

var filename_list = new Array();
var url_list = new Array();
var url_target_list:Array = new Array();
var title_list = new Array();
var description_list = new Array();

var i:Number;
var tn:Number = 0;
var scale_factor:Number = 0.6;
var tween_duration:Number = 0.8;

var angle:Number;
var degree:Number
var total:Number;
var flashmo_xml:XML = new XML();
var folder:String = "thumbnails/";
var xml_loader:URLLoader = new URLLoader();
xml_loader.load(new URLRequest("flashmo_129_thumbnail_list.xml"));
xml_loader.addEventListener(Event.COMPLETE, create_thumbnail);

var thumbnail_group:MovieClip = new MovieClip();
stage.addChild(thumbnail_group);

thumbnail_group.x = tn_group.x;
var default_y:Number = thumbnail_group.y = tn_group.y;

tn_group.visible = false;
fm_previous.visible = false;
fm_next.visible = false;

tn_title.text = "";
tn_desc.text = "";


function create_thumbnail(e:Event):void 
{
	flashmo_xml = XML(e.target.data);
	total = flashmo_xml.thumbnail.length();
	angle = Math.PI * 2 / total;
	degree = Math.round( angle * 180 / Math.PI );

	for( i = 0; i < total; i++ )
	{
		filename_list.push( flashmo_xml.thumbnail[i][email protected]() );
		url_list.push( flashmo_xml.thumbnail[i][email protected]() );
		url_target_list.push( flashmo_xml.thumbnail[i][email protected]() );
		title_list.push( flashmo_xml.thumbnail[i][email protected]() );
		description_list.push( flashmo_xml.thumbnail[i][email protected]() );
	}
	load_tn();
}

function load_tn():void
{
	var pic_request:URLRequest = new URLRequest( folder + filename_list[tn] );
	var pic_loader:Loader = new Loader();

	pic_loader.load(pic_request);
	pic_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, on_loaded);
	tn++;
}

function on_loaded(e:Event):void
{
	if( tn < total )
	{
		load_tn();
	}
	else
	{
		fm_previous.visible = true;
		fm_next.visible = true;
		fm_previous.addEventListener( MouseEvent.CLICK, to_previous );
		fm_next.addEventListener( MouseEvent.CLICK, to_next );
		
	}

	var flashmo_bm:Bitmap = new Bitmap();
	var flashmo_mc:MovieClip = new MovieClip();

	flashmo_bm = Bitmap(e.target.content);
	flashmo_bm.x = - flashmo_bm.width * 0.5;
	flashmo_bm.y = - flashmo_bm.height * 0.5;
	flashmo_bm.smoothing = true;
	
	var bg_width = flashmo_bm.width + 10;
	var bg_height = flashmo_bm.height + 10;
	
	flashmo_mc.addChild(flashmo_bm);
	flashmo_mc.graphics.beginFill(0x666666);
	flashmo_mc.graphics.drawRect( - bg_width * 0.51, - bg_height * 0.51, bg_width * 1.02, bg_height * 1.02 );
	flashmo_mc.graphics.beginFill(0xFFFFFF);
	flashmo_mc.graphics.drawRect( - bg_width * 0.5, - bg_height * 0.5, bg_width, bg_height );
	flashmo_mc.graphics.endFill();
	
	flashmo_mc.name = "flashmo_" + thumbnail_group.numChildren;
	flashmo_mc.buttonMode = true;
	flashmo_mc.addEventListener( MouseEvent.MOUSE_OVER, tn_over );
	flashmo_mc.addEventListener( MouseEvent.MOUSE_OUT, tn_out );
	flashmo_mc.addEventListener( MouseEvent.CLICK, tn_click );
	flashmo_mc.scaleX = flashmo_mc.scaleY = scale_factor;

	flashmo_mc.x = Math.cos(thumbnail_group.numChildren * angle) * 200;
	flashmo_mc.y = Math.sin(thumbnail_group.numChildren * angle) * 200;
	flashmo_mc.rotation = thumbnail_group.numChildren * degree;

	thumbnail_group.addChild(flashmo_mc);
}

function tn_over(e:MouseEvent):void
{
	var mc:MovieClip = MovieClip(e.target);
	var s_no:Number = parseInt(mc.name.slice(8,10));
	
	thumbnail_group.addChild(mc);

	new Tween(mc, "scaleX", Elastic.easeOut, mc.scaleX, 1, tween_duration, true);
	new Tween(mc, "scaleY", Elastic.easeOut, mc.scaleY, 1, tween_duration, true);
	
	tn_title.text = title_list[s_no];
	tn_desc.text = description_list[s_no];
	
}

function tn_out(e:MouseEvent):void
{
	var mc:MovieClip = MovieClip(e.target);

	new Tween(mc, "scaleX", Strong.easeOut, mc.scaleX, scale_factor, tween_duration, true);
	new Tween(mc, "scaleY", Strong.easeOut, mc.scaleY, scale_factor, tween_duration, true);
	
	tn_title.text = "";
	tn_desc.text = "";
	
}

function tn_click(e:MouseEvent):void
{
	var mc:MovieClip = MovieClip(e.target);
	var s_no:Number = parseInt(mc.name.slice(8,10));
	 
	
}

function to_previous(e:MouseEvent):void
{
	new Tween( thumbnail_group, "rotation", Strong.easeOut, 
			  thumbnail_group.rotation, thumbnail_group.rotation + degree, tween_duration, true );
}

function to_next(e:MouseEvent):void
{
	new Tween( thumbnail_group, "rotation", Strong.easeOut, 
			  thumbnail_group.rotation, thumbnail_group.rotation - degree, tween_duration, true );
}

ODPOWIEDZ