Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » adding separate actions to two duplicateMovieClip instances


adding separate actions to two duplicateMovieClip instances

Reply
  #1 (permalink)  
Old 12-10-09, 02:46 PM
glennnall glennnall is offline
New Member
 
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
adding separate actions to two duplicateMovieClip instances

someone please offer me a little help here? no one seemed to want to help in the two other AS forums...

i'm editing a flash movie for a client where a button is duplicated with duplicateMovieClip when the file opens, creating two separate buttons ...

I'm unable to add any actions to the AS without it affecting BOTH instances.

can someone PLEASE help me with this ActionScript??? (i've been unable to get ANY assistance in THREE other AS forums).

I really appreciate any help.
GN
Reply With Quote
  #2 (permalink)  
Old 12-19-09, 09:39 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Can you post some of your code?
Reply With Quote
  #3 (permalink)  
Old 12-20-09, 08:26 AM
glennnall glennnall is offline
New Member
 
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
This is Frame 1 - i've uploaded the fla in case you'd look at it for me - what i'm trying to do is get one button to load one swf, and the other to load another swf - i can handle the loadMovieNum bit, but can't get any actions attached to only one button...

thanks for your help...

Code:
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
flashmo_logo._visible = false;
flashmo_logo._y = 100;
menu_item_group.menu_item._visible = false;
var menu_label:Array = new Array("Individuals", "Entreprenuers");
var menu_desc:Array = new Array("Personal Financial Services", "Executive Business Solutions", 
								"Executive Bonus and Benefits", "Protecting Future Earnings", 
								"Enjoying Your Successes", "Transfering Business Legacy", 
								"Delivering Comprehensive Solutions", "Office Location and Email Form");
// *** both 'menu label' array length and 'menu desc' array must be equal to number of
// *** total frames inside "menu button bg" Movie Clip in the library.
var total:Number = menu_label.length;
var tween_duration:Number = 1.2;// in seconds
var i:Number = 0;
function create_menu():Void
{
	position_x = i % 4 * 120 - 180;
	position_y = Math.floor(i / 4) * 120 - 60;

	var fm = menu_item_group.menu_item.duplicateMovieClip("menu_item" + i, i);
	fm.stop();
	fm.bg.gotoAndStop(i + 1);
	fm.over = true;
	fm.item_label = menu_label[i];
	fm.item_desc = menu_desc[i];
	fm.item_no = i;
	fm.flashmo_button._visible = false;
	fm.over = true;
	fm.flashmo_button.onRollOver = function()
	{
		this._parent.over = false;
	};
	fm.flashmo_button.onRollOut = fm.flashmo_button.onDragOut = function ()
	{
		this._parent.over = true;
	};
	fm.flashmo_button.onRelease = function()
	{
		_root.page = this._parent.item_no + 1;
		_root.play();
	};
	fm.onEnterFrame = function()
	{
		if (this.over == true)
		{
			this.prevFrame();
		}
		else
		{
			this.nextFrame();
		}
	};
	new Tween(fm, "_alpha", Strong.easeOut, 0, 100, tween_duration, true);
	new Tween(fm, "_rotation", Strong.easeOut, 180, 0, tween_duration, true);
	new Tween(fm, "_x", Strong.easeOut, position_x + 50, position_x, tween_duration, true);
	fm_tween = new Tween(fm, "_y", Strong.easeOut, position_y + 100, position_y, tween_duration, true);
	fm_tween.onMotionFinished = function() 
	{
   		fm.flashmo_button._visible = true;
	}
	if (i == total - 1)
	{
		fm_tween.onMotionFinished = function() 
		{
			fm.flashmo_button._visible = true;
			flashmo_logo._visible = true;
			new Tween(flashmo_logo, "_alpha", Strong.easeOut, 0, 100, tween_duration, true);
		}
		clearInterval(interval_id);
	}
	i++;
}
var interval_id = setInterval(create_menu, 140);
Attached Files
File Type: zip StampFinancialHomeORIG.zip (345.2 KB, 22 views)
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding sound to site with 5 separate flash files rjjjonline Flash & ActionScript 0 10-25-08 11:26 AM


All times are GMT -5. The time now is 06:48 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.