This is a discussion on "createEmptyMovieClip & onclick" within the Flash & Multimedia Forum section. This forum, and the thread "createEmptyMovieClip & onclick are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
createEmptyMovieClip & onclick
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
createEmptyMovieClip & onclick
Hello,
I am a beginner in Flash and I'm trying to make a slidebar which loads images from xml data, this works. However, I want to put an onclick event on it (in javascript i would make something like this: _root.bar['diagram'+p].onClick = displaydata(desciption[p]); function displaydata(content){ textbox1.text = content; } ) This is my actionscript code: <code> function firstImage() { for (p=0; p<(total); p++){ var newx = p * 106; _root.bar.createEmptyMovieClip('diagram'+p,p); _root.bar['diagram'+p].loadMovie(image[p], 1); _root.bar['diagram'+p]._x = newx; _root.bar['diagram'+p]._xscale = 50; _root.bar['diagram'+p]._yscale = 50; _root.bar['diagram'+p].onPress = function() { trace("You pressed me!"); } }} </code> Why does this part _root.bar['diagram'+p].onPress = function() { trace("You pressed me!"); } not work? and how can I get this to work? (Flash 8) Thank you! Richard Last edited by R Verbrugge; Sep 6th, 2007 at 21:22. Reason: Rude question to start of with ;) |
|
|
|
|||
|
Re: createEmptyMovieClip & onclick
Well it works like this:
Last Blog Entry: Yay!? (Oct 8th, 2007)
|
|
|||
|
Re: createEmptyMovieClip & onclick
I looked around on other pages and I noticed that for loadMovie() you cannot use a 'on (..)' command. instead the suggestion was to duplicate a mc and use the loadMovie() in that dupped movie.
this is what I made and works very nicely!
How is this done? |
|
|||
|
Re: createEmptyMovieClip & onclick
There are a few other recent posts about this, but here is a good source for information....
http://www.senocular.com/flash/tutorials/preloading/
Last Blog Entry: Yay!? (Oct 8th, 2007)
|
|
|||
|
preload..
Keep on hitting problems!
Main movie (one frame):
image[p].getBytesLoaded() ?!!? Last edited by R Verbrugge; Sep 13th, 2007 at 14:26. |
|
|||
|
Re: createEmptyMovieClip & onclick
Tried this:
if (imgholder.picture.onLoad = false){ trace('?'); _root.output.text = _root.output.text+"Loading.."+imgholder.picture; fillbar; } else if(imgholder.picture.onLoad = true){ imgholder.picture.loadMovie(image[p], 1, {_height:100,_width:100}); _root.output.text = _root.output.text+" Completed:"+imgholder.picture; } no dice. |
|
|||
|
Re: createEmptyMovieClip & onclick
Did you look at the link to the tutorial I sent you? Or are you wanting to build a preloader for each individual image as it is loaded.
Last Blog Entry: Yay!? (Oct 8th, 2007)
|
|
|||
|
Re: createEmptyMovieClip & onclick
Quote:
|
![]() |
| Tags |
| createemptymovieclip |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OnClick Behaviour | Monie | JavaScript Forum | 3 | Oct 23rd, 2007 02:13 |
| referencing createEmptyMovieClip with dynamic names | acidgreen | Flash & Multimedia Forum | 2 | Jun 5th, 2007 15:02 |
| OnClick to new URL and Submit together | plooner | JavaScript Forum | 2 | Feb 13th, 2007 11:48 |
| Need help on an onclick function | DaveKenroy | JavaScript Forum | 3 | Jan 28th, 2007 11:31 |
| onclick function | tomd1985 | JavaScript Forum | 0 | Mar 13th, 2006 18:20 |