|
-
Crazy Guy
[F8] need help with loading external images and interacting with them
hello 
currently i'm trying to something (more complex than the little example given below) where i need to attach an externally loaded image (that can't be kept in the fla file) and then be able to do stuff when that image is rolled over, rolled out of, or clicked on.
I'm able to get the image there using loadMovie but then when i apply mouse events to the movieclip the image is loaded to, then they don't seem to do anything.....
here is a small example of how i used loadMovie
code: class test extends MovieClip
{
private var container:MovieClip;
public function test()
{
_root.createEmptyMovieClip("test", 1);
container = _root.test;
//assuming there is a bob.png file in the same directory as the swf
//for example delfick755.googlepages.com/bob.png
container.loadMovie("bob.png");
container.onRollOver = function()
{
trace("hello");
};
}
}
so i was wondering if someone could help me please ??
thankyou
if you find some of my ideas weird, look at my avatar for the reason
-
FK'n_dog
create a nested clip - outer.inner
load to the inner clip, interact with the outer clip
outer.inner.loadMovie("a.jpg");
outer.onRelease = function(){..code..}
-
This looks interesting could you post an example of what you're doing please? I'm trying to load an external movie with a picture inside and a close button for a gallery and I have no idea of how to do that....please.
-
Crazy Guy
 Originally Posted by a_modified_dog
create a nested clip - outer.inner
load to the inner clip, interact with the outer clip
outer.inner.loadMovie("a.jpg");
outer.onRelease = function(){..code..}
awsome 
that works 
thankyou very much
if you find some of my ideas weird, look at my avatar for the reason
-
Crazy Guy
 Originally Posted by panchoskywalker
This looks interesting could you post an example of what you're doing please? I'm trying to load an external movie with a picture inside and a close button for a gallery and I have no idea of how to do that....please.
unlike pretty much every other thread on loading externel images in this forum (i did look before posting this, but they were all about bitmapData and i couldn't get it working) I'm not creating a gallery 
i'm actually trying to create this http://forum.compiz.org/viewtopic.php?t=832 using actionscript classes (more for the point of learning actionscript classes than anything else, i think i'm starting to get used to them )
this is what i have so far (don't mind the dodgy checkboxs, that's the point of this thread ) http://delfick.storage.googlepages.com/flashbsm.zip
....
if you find some of my ideas weird, look at my avatar for the reason
-
Crazy Guy
hmmm, there's only one problem with this, everytime the picture is changed there is a second where there is nothing as the image is loading.....
is there a way to make it so that there isn't that gap where it has to load the image ?? 
thnx
if you find some of my ideas weird, look at my avatar for the reason
-
FK'n_dog
preload all of the images, they will sit in the cache ready for instant load
-
Crazy Guy
k then...
how do i do that ?? 
thnx
if you find some of my ideas weird, look at my avatar for the reason
-
FK'n_dog
modify one of bokels multiple preloaders
http://www.bokelberg.de/actionscript/
or Google - multiple preload images *flash
-
Crazy Guy
cool thnx 
i'll have a look at that...
also, incase it makes a difference, the way i'm doing this is calling a function in the shapes class called createCheckBox and pass into it the movieclip i'm creating the checkbox in, the size of the checkbox (because i was using the drawing API before) and the state of the checkbox
shapes.createCheckBox(thePlugin.container.checkBox , 15, "off");
and then that function is
code: public static function createCheckBox(mc:MovieClip, sideLength:Number, type:String)
{
if (mc.pic == undefined)
{
mc.createEmptyMovieClip("pic", 200);
}
mc.clear();
switch (type)
{
case "on" :
mc.pic.loadMovie("images/checkbox/on.png");
//createStaticRectangle(mc, 0, 0, sideLength, sideLength, 1, 0, black, white, 0);
//createCircle(mc, sideLength / 2.5, 1, white, green, 50, sideLength / 2., sideLength / 2, false);
break;
case "off" :
mc.pic.loadMovie("images/checkbox/off.png");
//createStaticRectangle(mc, 0, 0, sideLength, sideLength, 1, 0, black, white, 0);
break;
case "inactive" :
mc.pic.loadMovie("images/checkbox/inactive.png");
//createStaticRectangle(mc, 0, 0, sideLength, sideLength, 1, 0, black, grey, 0);
break;
}
}
(unfortunately has to be static because when i do mc.onRollOver = function() { createCheckBox(<etc, etc) } it doesn't get called)
.....
Last edited by delfick; 07-09-2007 at 09:53 AM.
if you find some of my ideas weird, look at my avatar for the reason
-
FK'n_dog
or search my Code Bank (link in my sig.) for - preload
you'll find - LoadVars preload multiple images
-
Crazy Guy
i edited the last post after you posted again, does it make a difference to my problem ??
if you find some of my ideas weird, look at my avatar for the reason
-
FK'n_dog
does it make a difference to my problem ??
only you will know that when you have modified and tested
-
Crazy Guy
-
FK'n_dog
FTW was originally a tattoo, sported by prisoners which meant -
f*ck the world.
i s'pose you mean - For the win?
Who would use "for the win" in a conversation?
Fair dinkum you'd sound like a right d*ckhead, mate.
-
Crazy Guy
 Originally Posted by a_modified_dog
Fair dinkum you'd sound like a right d*ckhead, mate.
lol
yeah i meant for the win....
(and i don't use it in normal conversation, just the internet....)
if you find some of my ideas weird, look at my avatar for the reason
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
|