Old 02-02-2007   #1 (permalink)
photoshop ninja
 
agentxi's Avatar
 
Join Date: Oct 2006
Location: Red Deer - ish, alberta
Posts: 499

dynamic masks using actionscripting...

hey, i'm working on a flash project right now, and I've run into a problem.

I need to import an external swf file through actionscript. which i can do using the following code

Code:
play_btn.onPress = function () {
	_root.createEmptyMovieClip("movie_container", 1);
	loadMovie("movieclip.swf", "movie_container");
	movie_container._x = 150 ;
	movie_container._y = 20 ;
}
but now i need to apply a mask using an image (which i can do) but because i've loaded the external swf using a "createEmptyMovieClip" i now need to create a mask and apply it to the newly added movie clip. and this is where i am running into problems, my current code for applying mask is this...

movieclip.setMask (maskMovieClip)

or furthermore i found this code from a tutorial on kirupa
Code:
onClipEvent (load) {
	//this means, do something the moment this movie clip loads
	_root.normalpic.setmask(_root.camera.hole);
	//I want to see normalpic through the "hole". 
}
I just can't seem to get the clip to apply to the newly imported swf movie
I'm new to flash and actionscripting so any help advice on where to look or code snippets , it would be very appreciated.


here are the 2 tutorials I have been working off of.
kirupa.com - Scriptable Masks
kirupa.com - Loading Techniques: Flash 5 & Flash MX
__________________

Your a Graphic Designer...If you could go back in time you wouldn't go back to see the rise and fall of civilizations, you'd go back in time to destroy comic sans and papyrus.
agentxi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 02-02-2007   #2 (permalink)
photoshop ninja
 
agentxi's Avatar
 
Join Date: Oct 2006
Location: Red Deer - ish, alberta
Posts: 499

well thanks to mike,

this whole actionscripting thing clicked. I got what i wanted done. so now I get to try and resize the animations to fit the mask better...I'll post the finished work when i'm done

thanks mike!
__________________

Your a Graphic Designer...If you could go back in time you wouldn't go back to see the rise and fall of civilizations, you'd go back in time to destroy comic sans and papyrus.
agentxi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 02-04-2007   #3 (permalink)
Rusty Bio-Hazard!
 
notjustgraphics's Avatar
 
Join Date: Sep 2006
Location: Toronto, Ontario, Canada
Posts: 1,026

Send a message via MSN to notjustgraphics
No problem

Glad I could help!

Mike.
__________________
notjustgraphics is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
TUT--Flash; ActionScripting bedlam123 Tutorial Submission 1 03-05-2006 12:24 AM
dynamic world wolfchar The Marketplace 0 10-15-2004 10:59 AM


All times are GMT +1. The time now is 09:26 PM.
Content Relevant URLs by vBSEO 3.2.0 RC7

Design & Content © BioRUST 2007 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT