I was wondering if any one knows of a glitch in MX that doesn't allow you to call eventhandlers such as RollOvers and such once a MC has been used in a function. Because I got everything done for my movie except I can't get it to react once a rollover is performed. I can get the action to happen if I rollover another MC. But that just seems to be a unnecessary step. A fresh perspective on this would be greatly appreciated. Thanks Joey
It is just a coding/timing thing. There are two ways to fix it:
1. the hard way, build in a timer to add the function once you know everything is there.
2. the easy way, load into a blank holder.
Here is the easy way:
1. Delete the onload function from emptyMC
2. Delete the actions from the button
3. Replace the actions you have left with this:
Am I missing something?
It looks like you have edited the text file to show your movie instead of a JPG, which is of course impressive. But did you change anything else?
I usually don't like to put event handlers for buttons in the button. I prefer to use this syntax on the main timeline:
myButton.onRelease=function(){
function here
}
That lets you control the paths much easier. JPG should be the same by the way. I just had this little movie available.
- The right of the People to create Flash movies shall not be infringed. -
I haven't see your way of coding before but I am always happy if I can learn something new. I haven't tested your code so I apologize if I said it may not work.
- The right of the People to create Flash movies shall not be infringed. -
WOW! I work on this for hours trying to figure out what I am doing wrong, give up and post before I go to bed. I wake and I have 10 responses. Very impressive. Thank you both for your help. I took something away from both of your suggestions, however I went with AlsoGaiusCoffey code it worked great. I do have 2 other questions for you guys or anyone else who can answer. I have about 40 thumbnails that I want to use with this am I going to be able to reuse the functions without having to recall new LoadVars(); each time. Also mentioned earlier about cross domain being unsafe. I would prefer not to access the files from cross domain. I just used that pic as an example I have tried to set the var firstmc in the jpg.txt to the direct path on my machine, but I just keep getting errors.
C:\Inetpub\wwwroot\someimg.jpg //doesnt work. http://www.someserver.com/someimg.jpg //does
Thats my point, I don't want to use crossdomain loading. I want to be able to call pics from a file on my machine just as you did with the movie you sent back. The problem is it won't regonize more than one. If you leave the file like you did it works just fine, but I get errors if I try to call more than one pic, like this:
Error opening URL "file:///C|/Inetpub/wwwroot/somefile/pic1.jpg
Ok figured it out. Flash doesn't like whitespace for whatever reason, so when I was placing each mc in the .txt file on a newline it was having a seizure. I don't know why this doesn't happen with other files I have used for variables of text, but it doesn't like it for addresses to file. I just placed every variable like so:
a=pic1.jpg&b=pic2.jpg etc and it works great. Thanks again for all the help I got.
Joey
White space is a character in itself - as is tab, carriage return etc. Flash's behaviour is entirely correct. Try using a filename with a line feed in it and you will see what I mean!