|
|
 |
September 5th, 2007, 07:45 AM
|
#1
|
|
New Member
Join Date: Sep 2007
Location: Bristol, UK
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Image loader problem!
Hi there guys,
I'm having a real headache problem and I can't work out a solution! I am building a flash site where I have gallery sections. I have created a thumbnail button as a movieclip that basically changes its alpha value as you roll over it. I have then created an invisible button to house the script. Fine. I then want to drag this movieclip onto the main stage and use the loader compontent to dynamically load the images from the movieclip thumbnails. I have named the component "myloader" and the code I am using is as follows:
Code:
on(release){
myloader.contentPath="image1.swf";
}
However, this meets with no reaction! The Image1. swf file is in the right directory, and when I assign this code to a simple button it works fine, but this removes my ability to have a nice interactive button. Help! I am fairly new to actionscript and programming in general so am probably missing something really simple, but any guidance would be greatly appreciated!
Thank you.
Last edited by karinne; September 6th, 2007 at 11:28 AM..
Reason: Please use [ code ]...[ /code ] tags when displaying code.
|
|
|
September 5th, 2007, 11:23 AM
|
#2
|
|
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 27
Posts: 665
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Image loader problem!
You'll want it to look more like this....granted you are using AS2..
Code:
on(release){
myloader.loadMovie=("image1.swf");
}
|
|
|
September 5th, 2007, 11:38 AM
|
#3
|
|
New Member
Join Date: Sep 2007
Location: Bristol, UK
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Image loader problem!
Hi There,
Thanks so much for the reply. That doesn't seem to work for me either! I have experimented with putting the following code on the main timeline;
Code:
myBtn.onRelease = function() {
myloader.contentPath="image1.swf";
}
I gave the movieclip and instance name of myBtn and this works. I does however seem to stop the functionality of my movie clip! This is a fade in / fade out button that has the following code attached to the "invisible button";
Code:
on (rollOver) {
gotoAndPlay(2);
}
on (rollOut) {
gotoAndPlay(11);
}
I guess these two pieces of code are fighting with each other, but I don't know how to rectify the problem! Any suggestions would be greatly appreciated.
Thanks,
Tom.
Last edited by karinne; September 6th, 2007 at 11:28 AM..
Reason: Please use [ code ]...[ /code ] tags when displaying code.
|
|
|
September 5th, 2007, 11:41 AM
|
#4
|
|
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 27
Posts: 665
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Image loader problem!
Whoops take out the = sign...it's early and I missed that...
on(release){
myloader.loadMovie("image1. swf");
}
|
|
|
September 5th, 2007, 11:43 AM
|
#5
|
|
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 27
Posts: 665
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Image loader problem!
myBtn.onRelease = function() {
myloader.loadMovie("image1. swf");
}
You need this code for the button states:
Code:
myBtn.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
myBtn.onRollOver = function(){
rewind = false;
play();
}
myBtn.onRollOut = function(){
rewind = true;
}
Last edited by Sgaspar11; September 5th, 2007 at 11:48 AM..
|
|
|
September 5th, 2007, 12:05 PM
|
#6
|
|
New Member
Join Date: Sep 2007
Location: Bristol, UK
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Image loader problem!
Hi there,
Thanks again!
I'm just a bit confused as to where I put the code for the button state. On the same frame as the rest of the code, or somewhere else?
Sorry if this sounds like a dumb question! But I'm fairly new to this.
Thanks again.
|
|
|
September 5th, 2007, 12:08 PM
|
#7
|
|
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 27
Posts: 665
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Image loader problem!
you can put it in it's own layer above the buttons....I usually create an actions layer and put all my code there for easier sorting...
|
|
|
September 5th, 2007, 12:27 PM
|
#8
|
|
New Member
Join Date: Sep 2007
Location: Bristol, UK
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Image loader problem!
Hi ,
Thanks again. The code for the component works great but I am still having probs with my rollover states. I could send my experiment Fla. if that would help? If not, thanks for all of your time.
Tom.
|
|
|
September 5th, 2007, 02:10 PM
|
#9
|
|
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 27
Posts: 665
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Image loader problem!
Did you use the code supplied above? Make sure it is on its own layer above the "button"
One thing to change that might work is to change "myBtn" to "this".
See what that does.
|
|
|
September 6th, 2007, 04:10 AM
|
#10
|
|
New Member
Join Date: Sep 2007
Location: Bristol, UK
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Image loader problem!
Hi there,
Following on from my previous thread, I have a much simpler way of doing it!;
Code:
on (rollOver) {
gotoAndPlay(2);
}
on (rollOut) {
gotoAndPlay(11);
}
on (release) {
loadMovie("image1.swf", "_root.myloader");
}
That works just fine! Much simpler. I do like to make things hard for myself!
Thanks again.
Tom.
Last edited by karinne; September 6th, 2007 at 11:29 AM..
Reason: Added code tags
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|