View Full Version : Buttons dont work within Scroll Pane
Hello, I created a set of buttons. Each one links to a different video within a page and they work
perfectly...
except that when I select them all and convert them into one movieclip to put them inside a scrollpane,
they lose all the actions. (i checked the action box for each button and the code is there)
When tested they show up in the scrollpane fine (the images at least) but they dont link to their video....
Any ideas how to make it work!?
thummper
10-08-2010, 07:09 PM
pretty sure its a pathing issue, can you link a sample file?
I haven't published it yet, so I'm not sure but I imagine that it also needs the files it is linked to.... ?? (I am very new at all this)
but i can tell you what I did and maybe you can help me......
I imported jpeg images to the stage, distributed them to layers and then converted each one into a separate symbol (button). I also draged in a FLVPlayback component from the Components library and gave it an instance name of video_reel.
Then I wrote this in the action box of the frist button:
on (release) {
//load a video
this.video_reel.play ("Vivo Bumper006-Demo.flv") ;
}
and then copied and paste to the rest of the buttons changing the link for each one to the correct one for each.
Works perfect.....except that when I select all the buttons and convert them into one movie clip called thumbnails_MC ( I do this because I want to place them inside a scrollPane) they loose their action, thou the action is still writen inside the actionScript box. I then dragged the scrollPane component and named the source path as thumbnails_MC (my buttons movie clip), scrolls the buttons as images without the actions.... dont know what to do to fix it....
However I'll look into trying it on ActionScript 3 .....which, I Know now thanks to you, will probably be completely different....
Thank you!!
thummper
10-10-2010, 06:37 PM
correct me if im wrong, but your problem setup is:
video_reel
thumbnails_MC
-button1
--thumbnail image 1
-button N
--Thumbnail image N
The reason this doesnt work is because the buttons refer to a path this.video_reel, when they should either point to _root.video_reel (WARNING, this is a AS 1,2 only path type, it will break as3) or _parent.video_reel.
The forward thinking, better approach which willbe more in line with how you would write it in AS3 would be:
gallery_MC
-video_reel
-thumbnails_MC
--button1
---thumbnail image 1
--button N
---Thumbnail image N
Ive just wrapped everything in an MC so that its one 'object'. the thumbnail_MC is optional, but the code would be put on a keyframe within gallery_MC. This way the code is always pointing down (thumbnails_MC.button1.onRelease, video_real.play ). this isnt mandated in as1,2 but it is a good practice as none of your sub-groupings are broken if not included in the whole. (ie thumbnails can be imported in a different setting and assigned new code without breaking because there's no 'video_reel' above it). in AS3 this is considered 'correct'.
sinar
12-09-2010, 09:08 AM
thanxxxxxxxxxxxxxxxxxxxxxx