Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 27th, 2003, 08:29 AM
deland02 deland02 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 32 deland02 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m 38 sec
Reputation Power: 6
Infinate Menu Problems

Can anyone help, I looked at this tutorial on making an infinite menu and found it to be very useful:


http://www.kirupa.com/developer/mx/infinite.htm


the menu scrolls backward and forward following your mouse. I only want the menu to move when the mouse is over the menu.

I have changed the script so the menu is activated on(rollOver) but need help in telling the menu to stop when the mouse is not over it.

The script I am using at the moment is:


on(rollOver)
{
xcenter=150;
speed=1/10;
}
onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-300;
if (_x < -300) _x=0;
}



Any suggestions??

Reply With Quote
  #2  
Old November 27th, 2003, 10:10 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
Hi, try this out:

on(rollOver)
{
xcenter=150;
speed=1/10;
}

onClipEvent (enterFrame)
{
if(_ymouse > _y && _ymouse < _height)
{
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-300;
if (_x < -300) _x=0;
}
}


You may need to flip the < and > depending on your movie alignment. See which works.

-Tann

Reply With Quote
  #3  
Old November 27th, 2003, 10:11 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
Hi again, this may be better suited:

on(load)
{
mouseOn = false;
xcenter=150;
speed=1/10;
}

on(rollOver)
{
mouseOn = true;
}

on(rollOut)
{
mouseOn = false;
}

onClipEvent (enterFrame)
{
if(mouseOn)
{
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-300;
if (_x < -300) _x=0;
}
}


This version means you dont have to worry about the _y co-ord's at all, which is better if you have complex animations.

-Tann

Reply With Quote
  #4  
Old November 28th, 2003, 02:44 AM
deland02 deland02 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 32 deland02 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m 38 sec
Reputation Power: 6
Got it working thanks, although it needed the first line:

on(load)
{


to be changed to


onClipEvent (load)
{



Thanks loads, you saved me some right work.


Reply With Quote
  #5  
Old November 28th, 2003, 08:28 AM
deland02 deland02 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 32 deland02 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m 38 sec
Reputation Power: 6
Infinate Menu Button Problems

The menu's working sweet as a nut now but for some reason I cant get the buttons to do anything.

I want to add a command to the menu buttons so it plays scene 15 on the main timeline but when ever I try to add any command to any of the buttons nothing seams to work.

I think it might be a problem with my targeting, the script is on button 02 and attached the file

www.serioussounds.net/temp/infinate_menu.fla


HELP!!!!!

Reply With Quote
  #6  
Old November 28th, 2003, 08:30 AM
deland02 deland02 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 32 deland02 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m 38 sec
Reputation Power: 6

Reply With Quote
  #7  
Old November 28th, 2003, 08:44 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
Hi,

Swapped layers around in menu (text and button).
Moved and updated the button code. You had applied the button code to the movie clip and not the actual buttons. Yer I kinda figured that was my fault from my earlier post. Anyhow, I sorted it all out. Here ya go

-Tann
Attached Files
File Type: zip infinite menu.zip (4.6 KB, 336 views)

Reply With Quote
  #8  
Old November 28th, 2003, 09:03 AM
deland02 deland02 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 32 deland02 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m 38 sec
Reputation Power: 6
You beauty, I’d been driving my self mad wondering why the script wouldn’t work. Its always best to let a fresh set of eyes (with more experience) look over something.

Thanks

Reply With Quote
  #9  
Old December 15th, 2003, 11:47 AM
orange.man orange.man is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 18 orange.man User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi all

I've been playing round with this code for most of the day and wonder if anybody out there can help.

My problem is that I want to load images into the slide bar [data from a xml file], which when clicked will change the state of a main image above the slide bar.

I've been playing round for the last 6 hours trying to get the loaded images into buttons but can't seem to get it to work, know any tips that could help me out?

Thanks in advance

Reply With Quote
  #10  
Old December 15th, 2003, 03:38 PM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
Hi, how and where are you loading the images?

If your using the modified fla I posted why not try putting the image in the clip called menu, or at least the blank movies your going to load the images into. You can manually or dynamically position them there. Make the buttons alpha 0 and place its layer above the new image layer. If your doing everything with AS i.e. making blank movies and loading the images just make the new movies depth something high like 25, 26, 27 etc and then swap each with the relevant button via swapDepths. That way you can dynamically place the image under the button (so the button will still work).

Are you positive that the image name's are being read correctly i.e. got all the quotes sorted out, flash can be funny that way.
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #11  
Old December 16th, 2003, 05:19 AM
orange.man orange.man is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 18 orange.man User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Tann.

Posted a long reply this morning, but have made some good progress so I've edited.....


I'm getting my data from an xml file
PHP Code:
 slides_xml = new XML();
slides_xml.onLoad startSlideShow;
slides_xml.load("data.xml.inc.php");
slides_xml.ignoreWhite true


Then I'm doing the follwoing to put the images into the movie clip.

Instance Names:
menu_general instance name: WholeMenu
menu_general.menu [left] instance name: ImgClips
menu_general.menu [Right] instance name: ImgClips2

I've placed a empty movie into the menu called

I now duplicate ImgClip for each image by
PHP Code:
function startSlideShow(success) {
    if (
success == true) {
    
rootNode slides_xml.firstChild;
    
totalSlides rootNode.childNodes.length;
    
firstSlideNode rootNode.firstChild;
    
currentSlideNode firstSlideNode;
    
currentIndex 1;
            
    
Num=0;
    
NewSlideNode=rootNode.firstChild;
    while(
Num<totalSlides){
    
Num++;
            
_root.WholeMenu.ImgClips.duplicateMovieClip(ImgClip"img"+NumNum);
    
_root.WholeMenu.ImgClips2.duplicateMovieClip(ImgClip"img"+Num+NumNum);
            
    
imagePath2 NewSlideNode.attributes.imgSML;

    
_root.WholeMenu.ImgClips.ImgClip.loadMovie(imagePath2"img"+Num);
    
_root.WholeMenu.ImgClips2.ImgClip.loadMovie(imagePath2"img"+Num+Num);
            
    
_root.WholeMenu.ImgClips.setProperty("img"+Num,_x,(Num*70));
    
_root.WholeMenu.ImgClips2.setProperty("img"+Num+Num,_x,(Num*60));
    
_root.WholeMenu.ImgClips.setProperty("img"+Num,_y,20);
    
_root.WholeMenu.ImgClips2.setProperty("img"+Num+Num,_y,20);        
        }
        
    }



This works great, a image is loaded into the clip and moves with the mouseover action.

The only problem is that it only loads one image. I would have thought that it would load all the images [into img1, img2, img3 etc.], and space them at 60px intervals.

Any idea why it's only loading one image?
Here's my fla of progress so far:
http://www.anchovie.net/infinate_menu.trail.fla

Thanks in advance....

Last edited by orange.man : December 16th, 2003 at 06:40 AM.

Reply With Quote
  #12  
Old December 16th, 2003, 10:53 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
Hi, try this out. ill check back in a few hours

_root.WholeMenu.ImgClips.duplicateMovieClip(ImgClip, "img"+Num, Num);
_root.WholeMenu.ImgClips2.duplicateMovieClip(ImgClip, "img"+Num+Num, Num);

imagePath2 = NewSlideNode.attributes.imgSML;

clip1 = eval("_root.WholeMenu.ImgClips.img"+Num);
clip1.loadMovie(imagePath2);
clip2 = eval("_root.WholeMenu.ImgClips2.img"+Num+Num);
clip2.loadMovie(imagePath2);

Last edited by Tann San : December 16th, 2003 at 10:55 AM.

Reply With Quote