hey guys hope you can help with this one.
I am loading in a dynamic image from an external file, now I am loading it into an existing movieclip btu when I do the masking on the MC doesn't work :S
PHP Code:
product_shadow.setMask(masker);
thats the code I am using to set the masker inside the MC, this code is contained in the movieclip itself
What you need to do is set the mask on the clip that contains the image. When you load the external image file into product_shadow, you can no longer apply properties to product_shadow, so try setting the mask as such:
_root.b0.setMask(masker);
or if that screws up the image that gets loaded at _root.b0.product, you can do this:
_root.b0.product_shadow.createEmptyMovieClip("new_ mc", this.getNextHighestDepth());
then loadMovie("padlock_big.png", _root.b0.product_shadow.new_mc);
then you'll be able to apply the mask to _root.b0.product_shadow
eaglevision you are so helpfull i mean this world could not live without you.
HKR Chief, I have tried what you suggested previously (been googling it) but still cant seem to get it to work. Perhaps if I post the entire code it may help
Basicly the system is to load up dynamic png's into the movie clip of products and have it as a rotating menu system.
Last edited by neomaximus2k; 01-17-2008 at 10:18 AM.
I don't have Flash on the computer I'm at right now but I'll take it home and look at it over night and let you know what I find out. I'm sure you'll probably figure it out by then though.
I took a little time to work on your problem last night and I think I figured out how to do what you wanted.
First I noticed you were using a separate product_[number] in the library for each item you were adding to the stage. To reduce the number of items in the library, I removed all but one and named it "product_x". For the number of balls to add, it attaches the product_x from the library and names it b_[number].
Thne I figured out how the product_x movie clip is set up internally. I made a slight change inside it. Basically, instead of the upside down copy of the image being at _root.b0.product_shadow, I added another layer inside it and made it _root.b0.r.product_shadow (I think. I'm trying to remember from when I did it last night.)
Now, when you attach the movie clip, after it loads, it attaches a bitmapdata copy of it inside the _root.b0.r.product_shadow clip which gets masked properly.
So the result was what you were looking for, I believe. which is in the file carousel2.fla
I took it a step further for what I think you were heading towards. I made an xml file called files.xml. This file lists any product images you want to attach. I then made modified copies of the picture and added their names into the files.xml file. Then I modified the code to automatically attach whatever pictures that are named in the files.xml file. This is all in the zipped file I'm attaching. **Edit**:Actually, I had to make the zip file in two parts because it was too large.
One thing however that I couldn't figure out is, it plays fine when you do a control-enter from within Flash. But if you run the swf file by itself, it's not working and I don't know why that is.
Anyway, take a look and let me know if you have any questions. I hope this gets you going in the direction you were looking for. Also, take a look within the product_x clip at where the mask is, and where the image gets attached to so you can see what I did to make it work compared to why it wouldn't work before.
nice one chief, I had the xml code ready to insert and I was gonna do exactly as you said with just the one instance in the library (the multiple ones where there cause i was getting fed up of it not working lol)
I will need to expand on it a lot more but when its done i'll post the code cheers
The reason it didn't work from the html file is because it was set to access network files only and not local files, on the expert if you change it to local files it will then work a treat
Now to develop the php code to generate the xml file with the images, titles and links
Good deal. I was wondering if that's what it was, but I didn't have time to check. I was up an hour past my bedtime working on it as it was.
I think I learned a little bit while helping you out, by reading through your code and the way the product_[number] clips were set up. I'm going to keep that stuff in my collection to refer back to when I need to figure out how to do something that relates. Glad I was able to help. Good luck on the rest of it.
Only problem I am having now is defining a variable in each of the clips
for instance I have the product title working but I wanted to set a variable called link on each movieclip that holds the link to the url, the xml works fine but for some reason the variables doesn't get set
PHP Code:
for (n=0; n<=totalxmlitems; n++) { filename = filenamearray[n]; destinationclip = "b"+n; loader.loadClip(filename, _root[destinationclip].mainproductimage); _root[destinationclip].textbox = titlearray[n]; _root.destinationclip.linkage = filenamearray[n]; //I removed the following so it only loads the clip once. //loader.loadClip(filename, _root[destinationclip].r.holder); }
My flash skills are so off think i need to start it up again lol
I'm not sure I understand what you mean on your last question.
The only problem is when you hold the mouse on one of the products the text doesn't go away as it rotates, any ideas?
Do you mean if you hold the mouse in one position, then when the item rotates out from under the mouse, the text stays?
Where is the textbox for the producttitle? Is it right there with the product image? Does it rotate around with the image? Or is there one standard location where the text comes up, regardless of which item you rollOver? Once I get these particulars, I should be able to get you on the right path.
flash file attached you will see what i mean, i have attached the xml file aslwell but you will have to export as local files instead of network again (the file is edited on network machine hance why its set to network)
just rename the files.xml.renametoxml.fla to files.xml
this board really should check mime types otherwise it could easiy be hacked