
Welcome Guest
|
#1
|
||||
|
||||
|
hi!
i'm making a flash game. but no matter how i try i can't get the *** movieclip to move! ![]() is it possible to have two onEnterFrame functions running at the same time? any ideas? Please help!!! i also have a problem with a _mc.onPress function. i have an empty movieclip in which i upload a picture from xml. now i want to be able to click the movieclip to perform a function. the code is something like this: pic = node.firstChild.frstChild.attributes.thepic; _root.pic_mc.loadMovie("picfile/" + pic); pic.onPress = function() { trace("inside pic- function"); _root.anotherEmpty_mc.loadMovie("pic2"); } the uploading of the picture is no problem, that works just fine, the thing is that i never get into the pic.onPress- function. please !i don't know what to do!
|
|
#2
|
|||
|
|||
|
You can only have one onEnterFrame per timeline
You will have to wait for the movie to load before assigning onPress but i think your target should be root.pic_mc |
|
#3
|
|||
|
|||
|
You can only have one onEnterFrame per timeline, but every movieclip has its own timeline, so you can end up having as many onEnterFrame's as you have movieclips on any timeline, including the _root.
Code:
_root.clip1_mc.onEnterFrame = function(){
trace("foo");
}
_root.clip2_mc.onEnterFrame = function(){
trace("bar");
}1. start loading the movie into the existing clip 2. define the onPress for the clip 3. finish loading the movie into the clip- and overwrite any existing code on the clip So - what you need to do is define the onPress AFTER the load has completed. You can do this by using the an instance of the MovieClipLoader class to detect when the loadMovie has finished, and assign the onPress then. Code:
mcloader = new MovieClipLoader();
mcloader.addListener(this);
mcloader.loadClip(_root.container_mc,"myContent.swf");
function onLoadInit(target_mc:MovieClip){
if(target_mc == _root.container_mc){
_root.container_mc.onPress = function(){
trace("the onPress was defined after loading was complete");
}
}
mcloader.removeListener(this);
} |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Flash Encrypt protects action script | sintrix.com | New Softwares | 4 | 08-08-2007 05:07 AM |
| Flash Video Encoder Compare | flashfever2nd | New Softwares | 1 | 05-20-2006 03:46 AM |
| Flash Game Sponsorship | Games2Web | Work/Job Opportunities | 0 | 04-16-2006 01:42 AM |
| multiplayer flash game to sell | win32 | IT Bazaar Place | 0 | 12-10-2005 03:19 PM |
| Flash MX and XML game | razldazl | Site Check | 2 | 12-18-2004 01:24 AM |


!

