Another infinite menu question :)

i just finsihed the infinite menu tutorial and was wondering if i could make the menu only move when the mouse is over the sliding menu…
i was also wondering if i could make it stop moving after the mouse goes over it…thx

Didn’t try it, but that question was asked earlier… check this thread…

http://www.kirupaforum.com/showthread.php?s=&threadid=10256

ah yea that worked…so back to my first questino…someone asked the same quesiton here:
http://www.kirupaforum.com/showthread.php?s=&threadid=8997&perpage=15&highlight=infinite&pagenumber=2

and syko replied but i didn’t understand what he meant so could someone clarify that plz or teach me another way? thx very much

That is if you want to have rollOver buttons on the sides to get it to move.

like [<] [ ] [ ] [ ] [ ] [>]

Where [<] and [>] are buttons that you rollOver to move the menu.

Is that what you want to do?

If so, what Syko said is pretty clear :-\

nono i don’t want the arrows on the sides…is there a way to do without it?

That was the first link I sent. To do it on mouse over instead of through buttons on the side.

I haven’t experimented with the infinite menu yet, so those 2 methods that are in those links are the only ones I know about.

yea my AS is similar to the one in that link, but for some reason it still scrolls when the mouse isn’t over the sliding menu…i’m not sure why…but thx for your help anywayz

Did you add

on(rollOut)
{_root.scrollbar.menu.mode=true;}
on(rollOver)
{_root.scrollbar.menu.mode=false;}

To each of your buttons?

(instances names are subject to change for your file of course)

Sorry I can’t help more :-\ :frowning:

These links are broken. Anybody willing to explain ?

Fixed links (previous links were before the server change)…

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=10256

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=8997&perpage=15&highlight=infinite&pagenumber=2

speaking of infinite menus, i was wondering if the following can be acheieved:

  1. My infinite menu would have images loaded dynamically (the images could be anywhere between 5 to 50 or maybe more

  2. Once an image in the infinite menu is clicked then an enlarged version of that clicked image shall be shown in a seperate clip.

Being about a month old to MX, i am not sure if this can be achieved. I’m going to try it out anyways, but a direction could be helpful.

A “black box” of the procedure I am thinking of would be:

  1. create an array with the number of images.
  2. duplicate movieclips for the number specified
  3. load images thumbnails into each clip
  4. incorporate the sliding menu concept into it.

Can this be achieved???

Sure it would. :slight_smile:

movieClip.createEmptyMovieClip() might be useful too.

But I have never been able to control the height and width of a movie that is created using createEmptyMovieClip().

I can only specify the x & y coordinates. That would mean another set of gifs only as thumbnails…

Maybe this will help:

If you load another movie or image into an empty movie clip (which createEmptyMovieClip() produces), the empty clip will then size itself to the loaded clip/image. After the clip/image is loaded, you can can then use _x, _y, _width, _height, and all the other movieClip properties to control it. E.g.


// create a holder clip to contain my image
this.createEmptyMovieClip("holder_mc", 0);

// holder_mc is at 0,0, but has no _width or _height since it's empty

// load an image (200 by 100 in size) into holder_mc
this.holder_mc.loadMovie("myImage.jpg");

// upon loading, holder_mc is now at 0,0 with _width = 200, _height = 100

// after the movie has loaded, this will work:
this.holder_mc._x = 100;
this.holder_mc._y = 200;
etc.

Of course, a movieClip’s dimensions depend on it’s content. So when if the loaded image is initially 200 by 100 pixels, then changing the _width and _height won’t change that. Instead, _xscale and _yscale do the trick. But that is true of any movieClip, regardless of whether it is duplicated, attached, or created. In your case, if you load a tiny image into an empty clip, you can then scale it to the size you wish, or you can simply load an image that is of the proper large dimensions.

Of course, duplicate works fine too, as would attach. :slight_smile:

Hope something here helps!

*Originally posted by catreya *
**But I have never been able to control the height and width of a movie that is created using createEmptyMovieClip().

I can only specify the x & y coordinates. That would mean another set of gifs only as thumbnails… **

Well you can’t change the height and width because it is create<B>Empty</B>MovieClip(), if it is empty you won’t see any changes anyway, but besides that, when loading to it, once the object gets loaded all properties of the clip reset to default then change to accomadate the loaded object.

So, you would then have to wait for the image to fully load to the clip before being able to adjust the height and width of the clip.

cool… thanks for the info. i’ll get back once i’m done. :slight_smile:

ok here goes … As a test, I created a thumbmail of an image and duplicated it. the codes go like this:

[AS]
for (i=1;i<=10;i++) {
originalxpos = 66.7;
duplicateMovieClip (“mb0”, “mb”+i, i);
/duplicateMovieClip (“mb0”, “db”+i, i+10);/
plotXpos = getProperty(“mb”+(i-1),_x);
newXpos = originalxpos + plotXpos;
setProperty(“mb”+i, _x, newXpos);
/* setProperty(“db”+i, _x, newXpos+600);*/
}
onClipEvent(load) {
centerPosition = 300;
speed = 1/10;
}

onClipEvent(enterFrame) {
var distance = (_root._xmouse - centerPosition)/3;
_x += (distance * speed);
if (_x < 0) _x = 600;
if (_x >600) _x = 0;
}
[/AS]
the reason i created another set of images plotted outside the window was because the tut said so. but i found out I did not require them for the infinite effect. hence commented them out. the file i created can be viewed here

As you can see gaps emerge between the images. and some images overlap. i have tried changing coordinates of x after the if statements but it doesnt work. An error has to be in the condition statement because without them the scroll works like a charm.

any suggestions?

i decided to keep that problem aside for a while. Have been at it for hours now. The reasonable success of my earlier endeavor prompted me to get more adventerous. So I decided to load the thumbnails off another location and not load it into the Flash library first, convert it into a movie, blah, blah. (I am lazy)

So I wrote this one down on the first frame in the Actions layer:
[AS]
movieWidth = 60;
startPosition = -60
for (i=1;i<=9;i++) {
_root.createEmptyMovieClip(“movie”+i,i);
this.loadMovie(“image1.jpg”, “movie”+i);
startPosition = startPosition + movieWidth;
setProperty(“movie”+i, _x, startPosition);
}
stop();
[/AS]
Basicially wanted to see if I could load one jpg into multiple locations first. And guess what, just one copy loaded and it was not where I wanted it to be (_x=0 for the first one) but right in the center of the screen.

wat am i doing wrong?

another thing that I just realized. Since I do not have any static movie clips loaded into the fla, how am I going to invoke the onClipEvent (enterFrame) handler… well thats another story.

startPosition = startPosition + movieWidth;

If you look at that, you are putting all the clips in the same spot. -60+60 is always going to be 0.

What you could do instead is[AS]movieWidth = 60;
startPosition = -60
for (i=1;i<=9;i++) {
_root.createEmptyMovieClip(“movie”+i,i);
this.loadMovie(“image1.jpg”, “movie”+i);
this._x = i*movieWidth;
}
stop();[/AS]

As for the enterFrame deal, they are called dynamic event handlers, so you can call clip events via a frame instead of on the clip…

http://www.kirupa.com/developer/actionscript/tricks/dynamicevent.asp

if i recall my c programming correctly in a situation like this if say startposition = -60 and moviewidth = 60 during the first loop startposition = 0, during the second run of the loop i thought it would store the previous value of 0 on the RHS and compute the LHS. am i making any sense??? :sigh:

anyways, I tried your statement, but with the same result. just displays one jpg and not multiple copies and not at _x. just center of window.

what is wrong? this is so $%#$# frustrating!!! grrrrrr. like when in theory its suppossed to work but in practice it doesnt. i have been at it for like 5 hours now.

was anyone able to look at the earlier message in this thread (the duplicate movie thing)? some comments and suggestions would be appreciated!