June 20, 2013, 04:36:45 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Prowlie Welcome back! The site migration is complete and normal service resumed.
Advanced search
Pages: [1]   Go Down
Print
Author Topic: basic code help :]  (Read 1143 times)
0 Members and 1 Guest are viewing this topic.
Rvd
MotM
Senior Member
**
Offline Offline

Gender: Male
Posts: 681


No color and no sound


« on: January 08, 2010, 05:49:19 PM »

hey guys im hoping someone can help me with a very basic string of code that i have no idea why its not working. 
its basically just making a movieclip A bring up another movieclip B then when you click movieclip B it disappears. i get the code to work if its just placed on the timeline instead of on the movieclip but because of how i've already setup everything else i need to have the code on the movieclip. is this possible?


onClipEvent (load) {
   gotoAndStop(1);
}

on (release){
_root.attachMovie("red1","redlarge",1, {_x:150, _y:250});
   redlarge.onRelease = function() {
       this.removeMovieclip();
}
}


Logged

a.k.a cantdraw05
<a href="http://www.humbleego.com/iaward/iaward_2.swf" target="_blank">http://www.humbleego.com/iaward/iaward_2.swf</a><a href="http://img.photobucket.com/albums/v697/Espengenin/banner2brownstars.swf" target="_blank">http://img.photobucket.com/albums/v697/Espengenin/banner2brownstars.swf</a><a href="http://img.photobucket.com/albums/v697/Espengenin/banner2stars.swf" target="_blank">http://img.photobucket.com/albums/v697/Espengenin/banner2stars.swf</a><a href="http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=Jan%2008.swf" target="_blank">http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=Jan%2008.swf</a>
Jaehl
Mobal Gloderator
Global Moderator
Veteran
***
Offline Offline

Gender: Male
Posts: 1418


/* No comment */


WWW
« Reply #1 on: January 08, 2010, 10:00:14 PM »

I think the main problem is that you're using redlarge as a variable, but you can't do that in this instance. Smiley

This worked for me:
Code:
onClipEvent (load) {
gotoAndStop(1);
}

on (release){
var clip = _root.attachMovie("red1","redlarge",1, {_x:10, _y:20});
clip.onRelease = function() {
this.removeMovieClip();
}
}
Logged


<a href="http://i17.photobucket.com/albums/b90/Jaehll/Actionscript_Banner.swf" target="_blank">http://i17.photobucket.com/albums/b90/Jaehll/Actionscript_Banner.swf</a><a href="http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=oct%2Fnov%2007.swf" target="_blank">http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=oct%2Fnov%2007.swf</a>
Sarus translator:
<a href="http://www.jaehl.com/files/progress.swf" target="_blank">http://www.jaehl.com/files/progress.swf</a>
Rvd
MotM
Senior Member
**
Offline Offline

Gender: Male
Posts: 681


No color and no sound


« Reply #2 on: January 09, 2010, 05:10:14 AM »

thank you! it works great.  i hope to get that good someday.
thanks again man i really appreciate it.
Logged

a.k.a cantdraw05
<a href="http://www.humbleego.com/iaward/iaward_2.swf" target="_blank">http://www.humbleego.com/iaward/iaward_2.swf</a><a href="http://img.photobucket.com/albums/v697/Espengenin/banner2brownstars.swf" target="_blank">http://img.photobucket.com/albums/v697/Espengenin/banner2brownstars.swf</a><a href="http://img.photobucket.com/albums/v697/Espengenin/banner2stars.swf" target="_blank">http://img.photobucket.com/albums/v697/Espengenin/banner2stars.swf</a><a href="http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=Jan%2008.swf" target="_blank">http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=Jan%2008.swf</a>
Brackenwood
   

 Logged
Pages: [1]   Go Up
Print
Jump to:  

Theme by Pieter, based on Black Rain by Crip Powered by SMF 1.1.16 | SMF © 2011, Simple Machines XHTML | CSS

Page created in 0.05 seconds with 25 queries.