movieclip not having onrelease function
the movieclip named thmbs is not having working for the onRelease
function.
Code:
_root.createEmptyMovieClip("thmbla", _root.getNextHighestDepth());
thmbla._x = 250;
thmbla._y = 50;
_root.thmbla.createEmptyMovieClip("thmbs" + 1, thmblist.getNextHighestDepth());
var cLoader:MovieClipLoader = new MovieClipLoader();
cLoader.loadClip("d:/testcode/small/1.png", _root.thmbla["thmbs" + 1]);
_root.thmbla["thmbs" + (1)].onRelease = function()
{
trace("created");
}
this is the code
Code:
_root.createEmptyMovieClip("thmbla", _root.getNextHighestDepth());
thmbla._x = 250;
thmbla._y = 50;
for(i=0;i<5;i++){
_root.thmbla.createEmptyMovieClip("thmbs" + i, thmbla.getNextHighestDepth());
var cLoader:MovieClipLoader = new MovieClipLoader();
cLoader.loadClip("d:/testcode/small/1.png", _root.thmbla["thmbs" + i]);
_root.thmbla["thmbs" + i].onRelease = function()
{
trace("created");
}
}
_____________
Hi,
Not sure what you are trying to do, that code just puts 5 images on top of each other?
_____________
Hi,
Going from your original post this is using the full movieClipLoader process
PHP Code:
_root . createEmptyMovieClip ( "thmbla" , _root . getNextHighestDepth ()); thmbla . _x = 250 ; thmbla . _y = 50 ; _root . thmbla . createEmptyMovieClip ( "thmbs" , 0 ); // create clip loader cLoader = new MovieClipLoader (); mycLoader = new Object (); cLoader . addListener ( mycLoader ); // load clip cLoader . loadClip ( "d:/testcode/small/1.png" , _root . thmbla . thmbs ); // clip starts cLoader . onLoadStart = function() { _root . thmbla . thmbs . _visible = false ; }; // clip progress cLoader . onLoadProgress = function() { _root . thmbla . thmbs . _visible = false ; }; // clip completes cLoader . onLoadComplete = function() { _root . thmbla . thmbs . _visible = false ; }; // clip instigate other things cLoader . onLoadInit = function() { _root . thmbla . thmbs . _visible = true ; Initiate (); }; // make button work function Initiate () { _root . thmbla . thmbs . onPress = function() { trace ( this . _name ); }; }
with the movieClipLoader it needs to be fully loaded before you can assign anything to it.
my hobby
Last edited by fruitbeard; 01-20-2013 at 06:37 AM .
this is what i did
Code:
_root.createEmptyMovieClip("thmbla", _root.getNextHighestDepth());
thmbla._x = 250;
thmbla._y = 50;
for(i=0;i<5;i++){
_root.thmbla.createEmptyMovieClip("thmbs" + i, thmbla.getNextHighestDepth());
var cLoader:MovieClipLoader = new MovieClipLoader();
mycLoader = new Object();
cLoader.addListener(mycLoader);
cLoader.loadClip("d:/testcode/small/1.png", _root.thmbla["thmbs" + i]);
mycLoader.onLoadStart = function()
{
_root.thmbla.thmbs._visible = false;
};
// clip progress
mycLoader.onLoadProgress = function()
{
_root.thmbla.thmbs._visible = false;
};
// clip completes
mycLoader.onLoadComplete = function()
{
_root.thmbla.thmbs._visible = false;
};
// clip instigate other things
mycLoader.onLoadInit = function(){
_root.thmbla.thmbs._visible = true;
initiate();
}
function Initiate()
{
_root.thmbla.thmbs.onPress = function()
{
trace("created");
};
}
}
on press doesn't work pl note that i want each thmbs movieclip created within main movieclip thmbla to work as button and trace msg when clicked
when i use cloader.onLoadInit or other functions it gives me error "there is no property with the name 'onloadinit'"
_____________
Hi,
Firstly you rearranged the code and mycloader will not work as it is cloader, anyway, i'm feeling generous so here is the code to play around with, yes it works.
PHP Code:
var NumberRequired = 5 ; var Divide = 1 ; var Gap = 1 ; _root . createEmptyMovieClip ( "thmbla" , _root . getNextHighestDepth ()); thmbla . _x = 250 ; thmbla . _y = 50 ; cLoader = new MovieClipLoader (); mycLoader = new Object (); cLoader . addListener ( mycLoader ); for (var s = 0 ; s < NumberRequired ; s ++) { _root . thmbla . createEmptyMovieClip ( "thmbs" + s , s ); trace ( _root . thmbla [ "thmbs" + s ] + " @ Depth: " + _root . thmbla [ "thmbs" + s ]. getDepth ()); if ( s >= NumberRequired - 1 ) { i = 0 ; cLoader . loadClip ( "d:/testcode/small/1.png" , _root . thmbla [ "thmbs" + i ]); trace ( "Begin Loader Loop" ); } } cLoader . onLoadStart = function() { _root . thmbla [ "thmbs" + i ]. _visible = false ; }; cLoader . onLoadProgress = function() { _root . thmbla [ "thmbs" + i ]. _visible = false ; }; cLoader . onLoadComplete = function() { _root . thmbla [ "thmbs" + i ]. _visible = false ; }; cLoader . onLoadInit = function() { if ( i < NumberRequired - 1 ) { i ++; cLoader . loadClip ( "d:/testcode/small/1.png" , _root . thmbla [ "thmbs" + i ]); } else { Initiate (); } }; function Initiate () { for (var j = 0 ; j < NumberRequired ; j ++) { _root . thmbla [ "thmbs" + j ]. _visible = true ; _root . thmbla [ "thmbs" + j ]. forceSmoothing = true ; _root . thmbla [ "thmbs" + j ]. _y = Math . floor ( j / Divide ) * ( _root . thmbla [ "thmbs" + j ]. _height + Gap ); _root . thmbla [ "thmbs" + j ]. _x = 0 ; _root . thmbla [ "thmbs" + j ]. onPress = function() { trace ( this ); }; } }
it is a sequential clip loader !!
Last edited by fruitbeard; 01-20-2013 at 09:40 AM .
Is the best
made with fruitbeards patented design ^
_____________
Hi,
Not quite sure where to use the code from Allo Bacon, or if it helps at all, perhaps he is just increasing his post count again!!
i tested the code as u made and it gives me error
access of undefined property _root
access of undefined property thmbla
access of undefined property cloader
access of undefined property mycloader
i m attaching the fla Attachment 74049
_____________
Hi,
After testing your fla, I see nothing wrong.
I think you are publishing for AS3( I tried and got the errors) and not AS2 as is my coding, the other possibility is the image paths, but that is entirely relative to your situation so not really an issue.
I hope anybody else, can concur perhaps.
Is the best
I can do what I want and who really cares about post count, id take off the number if I could
_____________
Hi,
Yes you can do what you desire Alloy, but it's probably better to start a new thread rather than hijack another persons with garbage comments.
I'd personally love to see you helping somebody else with a bit of script.
thanx fruitbeard it works !!
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width