Menu Loading Another Menu
Here is my problem, my flash start with a menu using all the screen. When we choose an item in that menu all goes white and then a new menu appear in bottom of the windows... That's the easy part.
The second menu is all controled with as2 and tween. In fact that second menu is the same as the first one except the design of it but in fact there is the same stuff in it. What I want to do is when you click on the first menu it keeps in my the mc you click and on the second menu the item clicked is highlighted.
In fact if I have no awnser i would do it with scene on the first movie but in fact I would like to do it in action script...
thx
Xelaxam
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 01-15-2008, 11:29 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Flash Menu With Multiple HTML Pages - How To Pass Variable To Menu On Refresh?
please note this topic is also posted at AS under this title:
Flash Menu 4 HTML pages - pass variables on page refresh
-----------------------------------------------------------------------
So the subject is a hint as to how hard it is to search on this simple idea.
Will be very greatful for some help today!
PROBLEM DETAILS:
I am building a swf menu for an HTML site. It has the following buttons:
SectionA
SectionB
SectionC
What I want to do is modify the text when the HTML page for the correspoding section is loaded. So, if I click on "SectionB", SectionB.html loads. Now I want that button "SectionB" in the swf to have a background glow.
Of course the catch is, that each time a new HTML page loads, it reloads the swf menu (No Frames please!). So, naturally I know I can just tell the swf menu to go to a certain place in the timeline where there is the glow graphic behind "SectionB". But the swf needs a variable saying it is on a Section B HTML page. (of course I could build a seperate swf for each section - but that seems stupid.)
THUS....
MY QUESTION:
How do I pass a variable from a swf on one HTML page (that is being replaced by a new HTML page!), to a swf on a new HTML page.
Can I do this with a GET/POST or something?
Thanks!
-AB
Birdsong is online now Edit/Delete Message
Drop Down Menu PROBLEM-Down State For Sub-menu Item Linked To External SWFs?
Hi nice to meet everyone. The drop down menu I'm referring to is located in the main movie. The menu is a movie clip with the buttons inside and I have each button as 'track as menu item' in the properties. The buttons are linked to external swfs that load in the empty movie clip on the main movie stage. Everything loads perfectly no problem. I can't seem to figure out the right code to put on the sub-menu items/buttons in the drop down menu to show the 'down' state when the corresponding movie is loaded (i.e., about-main button, philosphy(menu item). When the 'philosphy' swf loads how do I get the 'philosphy' button that is in the main movie to show the 'down' state until another button is pressed on the menu? I hope I explained myself clear enough without confusing anyone!
Below is a sample of the code that I currently have on the the regular buttons that DO NOT sub-menu items:
on (release) {
gotoAndStop("home");
_root.contents.loadMovie("home.swf");
}
And here is the code that I currently have on the main buttons that have sub-menu items:
on (release) {
_root.contents.loadMovie("philosphy2.swf");
setProperty("_root.home", _visible, "0");
}
I have searched everywhere on the net, tutorials and still can't find the answer, I've been working on this for almost a week now and I just can't get it right.
Thanks again your help is greatly appreciated!
Dynamic Menu AS2.0/XML - Seperating Main Menu Title MC From Dropdown Item's MC
Hi everyone, this is my first post in this forum, I appreciate all the help
I've got a dynamic menu using AS2.0 that's being populated by an XML file, it's quite complete and is working fine, the only thing I'm having trouble with is assigning a new MC to the Titles so the visual design (Text and background) can be different from the rest of the dropdown menu.
What would have to be done to capture the menuNodes and isolate them form the rest. Below is the XML that I’m using, the highlighted (red, bold, italic) text below is what I’d like to capture and seperate from the rest of the submenus for the menu title in my flash project.
XML
----------------------------------------------
<?xml version="1.0"?>
<menu name="Atletas">
<menu name="Clubes">
<submenu name=""></submenu>
<submenu name="Botafogo">
<entry name="Player 1"/>
<entry name="Player 2"/>
<entry name="Player 3"/>
</submenu>
<submenu name="Flamengo">
<entry name="Player 1"/>
<entry name="Player 2"/>
<entry name="Player 3"/>
</submenu>
<submenu name="Flamengo">
<entry name="Player 1"/>
<entry name="Player 2"/>
<entry name="Player 3"/>
</submenu>
</menu>
<menu name="Atletas">
<submenu name="Gilberto"></submenu>
<submenu name="Jose"></submenu>
<submenu name="Joao"></submenu>
</menu>
<menu name="Posicoes">
<submenu name="Atacante">
<entry name="Gilberto"/>
</submenu>
<submenu name="Meio">
<entry name="Jose"/>
</submenu>
<submenu name="Zagueiro">
<entry name="Joao"/>
</submenu>
</menu>
</menu>
----------------------------------------------------------
attached is the screencapture of my flash design to understand what I'm talking about a little better.
Thanks for all the help
Drop Down Menu-Down State For Sub-menu Item Linked To External SWFs?
Hi nice to meet everyone. The drop down menu I'm referring to is located in the main movie. The menu is a movie clip with the buttons inside and I have each button as 'track as menu item' in the properties. The buttons are linked to external swfs that load in the empty movie clip on the main movie stage. Everything loads perfectly no problem. I can't seem to figure out the right code to put on the sub-menu items/buttons in the drop down menu to show the 'down' state when the corresponding movie is loaded (i.e., about-main button, philosphy(menu item). When the 'philosphy' swf loads how do I get the 'philosphy' button that is in the main movie to show the 'down' state until another button is pressed on the menu? I hope I explained myself clear enough without confusing anyone!
Below is a sample of the code that I currently have on the the regular buttons that DO NOT sub-menu items:
ActionScript Code:
on (release) {
gotoAndStop("home");
_root.contents.loadMovie("home.swf");
}
And here is the code that I currently have on the main buttons that have sub-menu items:
ActionScript Code:
on (release) {
_root.contents.loadMovie("philosphy2.swf");
setProperty("_root.home", _visible, "0");
}
I have searched everywhere on the net, tutorials and still can't find the answer, I've been working on this for almost a week now and I just can't get it right.
Thanks again your help is greatly appreciated!
Highlighting Menu Option On Flash Menu In HTML Page
Hi Folks,
I have created a Flash menu to work with an HTML based site (the menu is the object in all the pages), but I would like the menu option to stay highlighted when clicked. I've created a series of buttons that highlight when they are scrolled over, but when they are clicked, the button returns to its normal state, as it should. I did come up with a not-so-nice solution, by loading a new movie whenever the user clicks on the option, and the new movie has the menu selection highlighted. Is there a way for the user to click on the menu option and have it stay highlighted until a new menu selection is clicked without having to create mutliple movies?
Docking Flash Menu/Menu That Stays On The Bottom Of The Screen
i have a site designed but im attempting to get the navigation to stay docked on the bottom of the screen.
i've spent hours searching the web trying to come up with the solution but haven't succeeded
what im trying to do can be seen on the following site: http://www.mcbd.co.uk/
i want the nav to stay on the bottom of the screen when the page is resized.
if anyone can point me in the right direction it would be greatly appreciated.
thanks
Flash Sliding Menu / Horizontal Dynamic Picture Menu
Hello,
I am quite fascinated by the effect used to scroll a variety of pictures left and right with the ability to halt on a particular picture to click and navigate to another area of a site. Could anyone point me to a tutorial on how this is done? An good example of the effect may be seen on this site:
http://www.calatrava.com (click on the "slide show" link)
Would appreciate any pointers. Thanks!
Is There Anyway To Disable The Flash Player Dropdown Menu (not The Context Menu)
Greetings,
I am aware of how to reset the right-click context menu to just "settings", but when the file is opened in Flash Player directly from a computer instead of on the web, the drop-down menu in the player is still available. You can even press ctrl+enter to play. My searches just come up with solutions to the right-click menu, and I have a client who wants me to get rid of this menu for a game I've already made.
If you don't think there's even a way to do this, could you just tell me that so I can inform my client?
Thank you either way
[Using MX 2004 if it matters]
Help With Pop Up Menu (Sub Menu Buttons) Linking To Frame On Main Timeline
Hi,
I really need help with my flash project. I've created a pop up menu by having 4 buttons on the main timeline which I made into a movie clip which has an instance name of menu_mc. Inside that movie clip I have my sub menu created and the menu works great. My only problem is that I can't seem to link the submenu buttons to the frames created on the main timeline. I've tried all the action script I can think of. One example I am using is
menu_mc.contact_btn.onfiltered= function() {
gotoAndStop("Scene 1", "contact");
}
This is where I am trying to link the Contact Button (which is a submenu button of the About button) to the contact frame which is located on the main timeline. Please help me if you can. Thanks.
Flash Sliding Menu / Horizontal Dynamic Picture Menu
Hello,
I am quite fascinated by the effect used to scroll a variety of pictures left and right with the ability to halt on a particular picture to click and navigate to another area of a site. Could anyone point me to a tutorial on how this is done? An good example of the effect may be seen on this site:
http://www.calatrava.com (click on the "slide show" link)
Would appreciate any pointers. Thanks!
Tightest Menu Structure - Switch/case? BEST MENU
I'm looking to start building a new menu. I want to script it as tight as possible. There will be 7 buttons. When one is pressed, I want it to stay "pressed" until another is pressed.
What is the tightest way to structure this? I want to keep all script off of the buttons themselves. I was wondering if using a switch/case type structure would be best.
I searched a bit for what i was looking for, but could not find it. Does anyone have a example/thread they could throw my way?
thx.
How To Highlight An Active Menu Item In A Flash Menu
Hi,
I have a flash menu and I want each menu item to be highlighted according to which page it is on (e.g. Highlight the 'about us' link when the user is in the about us section) to save having to create more than one swf. At the moment I have all the highlights made invisible like this:
highlightOne._visible = false;
But have no idea how to make the swf know what page it is on or how to make a highlight visible accordingly.
Can anyone help me out?
Flash Menu Transparent Over A Static Html Menu, Can It Be Done?
To ensure I have noticeable menu items (if user does not have flash installed)acting as a menu that, in principle, is part of the background.
I have made a nice little flash menu and would like it to mimic the menu text underneath it. So, transparent flash over a static html menu, can it be done?
Menu Fades In On Rollover, But Buttons In Menu Not Working.
Hi,
My menuMC fades in to 100% when rollover the transparent button and fades outs upon rollout the transparent button.
However, the buttons in my menuMC is not working. Logically speaking, with the transparent button on top of my menu bar, it sorta blocked out my menu buttons. Any suggestions/other way around it ?
this script goes to my transparent button
ActionScript Code:
on(rollOver)
{
_root.menuMC.fade = "in";
}
on(rollOut)
{
_root.menuMC.fade = "out";
}
this script goes to my menuMc with buttons inside
ActionScript Code:
onClipEvent(load)
{
this._alpha = 0;
fade = 0;
}
onClipEvent(enterFrame)
{
if(fade == "out")
{
if(this._alpha > 0)
{
this._alpha -= 5;
}
else
{
fade = 0;
}
}
else if(fade == "in")
{
if(this._alpha < 100)
{
this._alpha += 5;
}
else
{
fade = 0;
}
}
}
Appreciate what helps i get.
How To: Create A Drop Down Menu With XML Data For Menu Items
Can anyone help by showing me or pointing me in the right direction of how I'd go about creating a drop down menu and populating the menu items from an XML file?
I'm creating a tour sort of thing and I have it pulling in the slides of the tour from an XML file and all the next/prev buttons are working fine. I wanted to add a drop down menu from the top that has the menu items pulling in from elements from the XML file. Possible? Ideas?
Thx
Menu Vs. Submenu Appearance : XML-Driven Drop-Down Menu Help
I love Senocular's XML-Driven Drop-Down Tutorial. But I can't seem to get it to make the menu headers look different from the submenus.
Any help?
See the tutorial
Much appreciated.
(and if anyone is interested, i've turned it into a horizonal menu... reply and i'll post the code. better yet, help me fix the GUI issue and i'll post it )
Menu Navigation Help Desperate Moving Menu Buttons
Hi On my flash site i have a list of buttons, when i rollover one of the buutons i want sub menu buttons to appear below it and push the other buttons down to make space, and on moue out the buttons to move back up to original place, how can i go abut doing this? hope someone can help really desperate
Menu Fades In On Rollover, But Buttons In Menu Not Working.
Hi,
My menuMC fades in to 100% when rollover the transparent button and fades outs upon rollout the transparent button.
However, the buttons in my menuMC is not working. Logically speaking, with the transparent button on top of my menu bar, it sorta blocked out my menu buttons. Any suggestions/other way around it :confused: ?
this script goes to my transparent button
ActionScript Code:
on(rollOver){_root.menuMC.fade = "in";} on(rollOut){_root.menuMC.fade = "out";}
this script goes to my menuMc with buttons inside
ActionScript Code:
onClipEvent(load){this._alpha = 0;fade = 0;} onClipEvent(enterFrame){if(fade == "out"){if(this._alpha > 0){this._alpha -= 5;}else{fade = 0;}}else if(fade == "in"){if(this._alpha < 100){this._alpha += 5;}else{fade = 0;}}}
Appreciate your help. Thanks
Flash Expanding Menu Instead Of Javascript Drop Down Menu?
I am trying to make a flash file that will take the place of a javascript drop down menu. I need to have a slim horizontal menu bar surrounded top and bottom by the rest of the HTML webpage.
The function of the flash menu would be such that when one of the buttons are moused over > the menu would expand over the HTML images below it with more menu buttons.
This is really easy to do with javascript but I want the creative freedom flash offers. Does anyone know how I can create a flash file that can expand larger than it’s original size on the webpage
I have seen some really neat flash banner ads that definitely are on top of other html. Maybe I could do something like that.
Please let me know any ideas or resources I could use to do this.
Thanks.
Combine XML Menu Tutorial With Verticle Sliding Menu
Hey Guys,
IM trying to combine the dynamic XML menu tutorial found here on Kirupa with a tut ive found else where.
Now I under stand how the sliding tutorial works, but its based on some fixed dimensions.
Obviously the dimensions of the XML menu can change as items are added ...if any one could take a look a source (below) and tell me where to start referencing the variouse dimensions involved?
The news.xml and news.fla files contain a rough working model of the XML menu in case they are fo any use?
LINK: www.nineironmusic.co.uk/scrollmenu.zip
Scroll menu AS:
ActionScript Code:
mouseX = _ymouse;menuX = menu._y;if (mouseX > 280) { diff = (mouseX-280)/15;}if (mouseX < 220) { diff = (220-mouseX)/15;}if (mouseX <= 250 && menuX <= 56) { setProperty("menu", _y, menuX+diff);}if (mouseX >= 250 && menuX >= -204) { setProperty("menu", _y, menuX-diff);}if (menu._y >= 56) { menu._y = 56;} else if (menu._y <= -204) { menu._y = -204; }gotoAndPlay(2);
Thanks... once again!
Zaid
XML Menu Tute: Reference Item Within Menu Items
With reference to: http://www.kirupa.com/developer/acti...pdown_menu.htm
Im using a version of this menu, but each menu item has another movie clip inside it.
I cant for the life of me work out how to give this sub clip its own function?
I've tried setting the onRelease to be triggered by the 'background' movie clip of the menu item but this stop the menu working, and when I reference any other sub clips like so: curr_item.someClip.onRelease ...there's also no response.
Where am i going wrong?
How To: Create A Drop Down Menu With XML Data For Menu Items
Can anyone help by showing me or pointing me in the right direction of how I'd go about creating a drop down menu and populating the menu items from an XML file?
I'm creating a tour sort of thing and I have it pulling in the slides of the tour from an XML file and all the next/prev buttons are working fine. I wanted to add a drop down menu from the top that has the menu items pulling in from elements from the XML file. Possible? Ideas?
Thx
Menu Vs. Submenu Appearance : XML-Driven Drop-Down Menu Help
I love Senocular's XML-Driven Drop-Down Tutorial. But I can't seem to get it to make the menu headers look different from the submenus.
Any help?
See the tutorial
Much appreciated.
(and if anyone is interested, i've turned it into a horizonal menu... reply and i'll post the code. better yet, help me fix the GUI issue and i'll post it )
Menu Navigation Help Desperate Moving Menu Buttons
Hi On my flash site i have a list of buttons, when i rollover one of the buutons i want sub menu buttons to appear below it and push the other buttons down to make space, and on moue out the buttons to move back up to original place, how can i go abut doing this? hope someone can help really desperate
[F8] Loading Menu
Im going to start making my own flash template for my website. Im not too fussed about an intro page but I would like to make one of thoses custom loading screens that when it hits 100% it then takes you to the custom flash template for your website in animations form.
Does anyone know how I can make this loading screen? Is there a little tutorial anywere?
Thanks.
Loading Menu
The loading layers itself are four frames:
Frame 1: Loading
Frame 2: Loading.
Frame 3: Loading..
Frame 4: Loading...
I would like to these 4 layers to loop until the file has finished loading. After it has I would like for it to display the next layer on frame 5... If somebody can help me that would be great!
Thanks
Slider Menu Loading Help
I'm thinking of doing a site for a local band, somewhat like this example http://www.onclipevent.com/navneetk/test/exp8.htm however im looking to do some up and down scrolling in some areas, anyways, to conserve data transfer on their hosting server (i think they get a whoppin 1 GB a year, and they're lookin to host mp3s etc there, im gonna hafta tell em its not gonna happen), i need to be able to load each section individually, because not everyone is gonna look through the entire site most likely, but those who slide past a section, i dont want it to be blank either, i think i'm going to load dynamic text to each section so i can let em do whatever they want to it after im done, but my question is: how would you load something when the menu stops on a particular section? (NO BUTTONS) any and all help appreciated
Loading Message And Menu
Could someone help me on building a menu in flash. And how can i put a message: Loading 12... 13... 14... 15% an so on... ?
Thanks
XP
Flash Menu Loading
Hello.
Need some help here.
I went live with a site for a client last night. Heres the story.
The site contained vey sinple flash menus that used a database to bring up pages. All was well. Last night I made new menus that do the same thing, just have more products added. Whats happening now is that the flash isn't coming up or not loading into the area it is supposed to be. (Which is the bottom of the screen). It work 100% on my dev server, but once live it ain't doing squat.
the link is : www.cadac.co.za click on South Africa and then products.
Am I doing something with regards to publishing wrong?
Thanks!
Loading Menu Items Using ASP
hey people,
i need to know how to make a dynamic menu generated from my access database using ASP. can anyone suggest some good tutorials or shed some light on the sugject?
thanks heaps!
mish
Loading Menu On Mouse Over
I am loading a menu on mouse over button a and want to unload when mouse is over button b. I have it working but whenever my mouse goes over button b the menu shows then unloads. How can I stop this from happening? I was thinking an ifFrameLoaded command but I can't make it work.
Loading A Dynamic Menu From Xml
Im using xml and trying to create a dynamic menu. got two questions...
after reading the content of the xml file into an array I want to create multiple instances of movies - each uses a node's info, such as name, description etc. the problem is that I dont really know how many will I have. it could be 3 or 30. how do I make sure that
1. they align wel in a small frame I am going to give them (like no more than 4 in a row)
2. when they are out of this frame, a scrollbar will be crated
any help will do...
Niva Aldema
Loading SWF Movies Through Swf Menu
I'm trying to develop a menu in flash with links to robo demo...swfs. I have about 10 movies that need to be accessible via a flash menu. Who do i do this...please help this beginner
Loading A Movie From Outside Menu
Not a flash expert at all.
What i have created is two seperate swf files. One contains the menu, the other contains the main website.
I have all my pages loaded into the main.swf file (about us, services, contact page etc etc). My other file which is seperate contains my menu with links/buttons home, about us etc etc. How can i use that external menu to load a certain target on my main movie file (main.swf). In other words how would i target it? If i load main.swf _root.aboutus how can i get it to load in the main.swf window and not the menu.swf?
Easing Menu Loading Help.
Hi,
I'm hoping someone might be able to give me some direction with these questions. I would like to build on comciGeek's "Easing menu System" found here http://www.actionscript.org/tutorial...em/index.shtml
I would like to load in different movies into level2 when clicking any given button. The problem is that I'd like the movie I call in not to load until the animation on the base level comes to a complete stop. Also if I currently have a movie loaded in and decide to click another button, can I have the base animation wait until it unloads before easing over to it's next coordinates.
I'm not looking for anyone to do this for me, but would really appreciate any help you might be able to offer up.
Thanks for your time, Jason.
XML Menu Loading Problem
How do I only load the first Nodes and its siblings without loading the childs also? menu and submenu are currently loading together and labels are undefined.
Here is my code
Code:
/////////////////////////////////////////
//////////////// VARS ////////////////
/////////////////////////////////////////
var xPos = 20;
var yPos = 40;
/////////////////////////////////////////
//////////////// Load XML /////////////
/////////////////////////////////////////
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(){
GenerateMenu();
}
menu_xml.load("menu.xml");
/////////////////////////////////////////
//////////////// Create Menu ////////
/////////////////////////////////////////
function GenerateMenu(){
for (i=0; i<menu_xml.firstChild.childNodes.length; i++) {
attachMovie("container", "new"+i, this.getNextHighestDepth(), {_x:xPos, _y:yPos});
yPos += this["new"+i]._height;
this["new"+i].label_txt.text = menu_xml.firstChild.nextSibling.attributes.label;
this["new"+i].url_btn._url = menu_xml.firstChild.nextSibling.attributes.link;
}
}
Loading Jpg's Into A Scrolling Menu
hi...i am trying to do something very simple however apparently not simple enough. i built a scrolling menu from a tutorial that loads the image thumbnails with xml...and it works. however now i have to switch it to loading external jpg's with load movie clip instead (not my choice). it is not meshing with my scrollbar, in that it won't load the images. here is what i have:
Code:
var imagePath:String = "img/";// folder with jpgs
var picnames:Array = new Array;
picnames[0] = "cdw";
picnames[1] = "clb";
picnames[2] = "cslg";
picnames[3] = "cobc";
picnames[4] = "clheb";
picnames[5] = "ucpb";
picnames[6] = "c2";
picnames[7] = "cbfc";
picnames[8] = "c2dry";
picnames[9] = "bp";
picnames[10] = "cdkc";
picnames[11] = "cdfc";
picnames[12] = "ahsds";
picnames[13] = "ccu";
picnames[14] = "cdbc";
picnames[15] = "mtbc";
picnames[16] = "mtbcts";
picnames[17] = "atbc";
picnames[18] = "cbatbc";
picnames[19] = "ctw";
picnames[20] = "crm";
picnames[21] = "cbw";
picnames[22] = "cds";
picnames[23] = "omspray";
picnames[24] = "ompowder"
for (i=0;i<picnames.length;i++) {
thumbURL.push(imagePath + picnames[this.i] + ".jpg");
}
trace(thumbURL);
//trace(prodID);
makePanel();
var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip(thumbURL[0], container);
function onLoadInit(mc:MovieClip) {
trace("onLoadInit: " + mc);
}
it traces out my image paths...and i did a test load movie for one of the images and it loads...but it won't load into my scrollbar. here is code for that:
Code:
function makePanel() {//this function creates the panel clip and mask
thumbClips = new Array;//Clears thumbClips array if it already has info in it
home.createEmptyMovieClip("theMask", home.getNextHighestDepth());//Creates mask clip
home.createEmptyMovieClip("thePanel", home.getNextHighestDepth());//Creates panel clip
thePanel._y = 30;
thePanel._x = 20;
loadThumbs(counter);//Calls function to load thumbnails with "counter" variable
}
function loadThumbs(who) {//This function creates thumbnail clip and calls MovieClipLoader to load thumbnail image
var z = thePanel.createEmptyMovieClip("tClip"+who, thePanel.getNextHighestDepth());//Creates thumbnail clip inside panel clip and assigns to temp variable "z"
thumbMcl.loadClip(thumbURL[who], z);//Calls thumnail's MovieClipLoader to load image from array into the "z" clip
}
var thumbMcl:MovieClipLoader = new MovieClipLoader();//Creates thumbnail's MovieClipLoader Object
//Creates listener for thumbnail's MovieClipLoader
thumbMcl.addListener(tMclListener); //Registers listener with MovieClipLoader
which then continues on with the load init function, etc. i didn't include all the variable declarations for the above to save space.
any help is appreciated....thank you!!
Loading A Menu MovieClip
Greetings,
I'm new to AS3, so I'm giving myself a pretty big project to learn it. I've been able to figure most things out with the help of Tutorials and useful AS3 tips up until now.
Basically, I've create a movieClip called mcGui that uses the class Gui. Within the movieClip I've created frame labels and places buttons and text at the different frames. There's a label named "title" which resides on the first frame and has the button btnStart. There's a label named "story" that resides on the tenth frame and has the button btnNext.
Now, I call this movieClip from my main timeline with:
ActionScript Code:
var myGui:Gui = new Gui("story");
addChild(myGui);
Here's the Gui.as class:
ActionScript Code:
package com {
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.events.*;
public class Gui extends MovieClip {
function Gui(lbl:String) {
this.gotoAndStop(lbl);
trace(this.currentFrame);
switch (lbl) {
case "title":
btnStart.addEventListener(MouseEvent.CLICK, fncStart);
break;
case "story":
btnNext.addEventListener(MouseEvent.CLICK, fncNext);
break;
}
}
function fncStart(e:MouseEvent):void {
trace("START");
}
function fncNext(e:MouseEvent):void {
trace("NEXT");
}
}
}
Now, my trace function shows that I am going to frame 10 on my movieClip, however I keep getting this error.
Quote:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com::Gui()
at test_r1_fla::MainTimeline/frame1()
It don't get this error if I try to go to the "title" frame label. So, it's like the btnNext doesn't exist.
Any ideas? I'm really stuck on this.
Loading MC With Dock Menu?
I have been wanting to make a dock much like the Apple dock but for images like a gallery trouble is I dont know how to tell the AS to load the image into the specified MC container when clicked. I know very little AS so I was a little bit overwhelmed when I tried figuring out how to do this.
Here are the script I have been looking at:
Archive.zip
I would really appricitae any help as Im a bit boggled
thanx
Menu For Loading Video
Hi guys...
im having a bit of a nightmare adding video to the stage underneath a movieclip already on the stage...
also, i cant seem to get the video's to load to the stage from a menu, which is itself a movieclip, that is already on the stage...
i hope this makes sense... the swf can be seen at www.pineapplearts.com/rob/pine_menu.swf to make it a bit clerer for you....
basically i want to be able to load a video underneath the curtains but in the middle of the stage from the roll out menu "part 1, part 2" etc buttons....
any help you can give me will be appreciated!!
thanks in advance!!
Rob
p.s. here is the fla if it will help www.pineapplearts.com/rob/Rob.zip
XML Menu Loading New SWF W/ Transition Yaa
I've got a dynamic menu using XML. Works great.
I've got a movieclip called "content" into which you'd load SWF's and a movieclip called "transition" which fade in and out when you load the new SWF's.
How do I combine the two, because the menu is dynamic from XML I don't know how do address the buttons. Please help me!!
See attached ZIP File.
Thanks.
Ads.
Loading Xml In Jump Menu
Hello friends!
I have a php file which generates an xml file. How can I make the jump menu read from that file? the idea is that the client can change the data in the admin section that's y i made it php which will generate an xml file i used it to load photos, news etc...
how can i make the jump menu to read from such file? so that when selecting a category it will go to its url?
Thanks
Loading Movies From Sub Menu
Hi I'm having problems loading movies from a sub menu.
Basically I have a primary navigation and secondary or nested menu
on one menu item. The following load movie script works fine on the primary menu on the root:
about_mc.onRelease = function() {
createEmptyMovieClip("container2", 1);
loadMovie("about2.swf", "container2");
container2._x = 0;
container2._y = 0;
};
However I'm using the following script on the nested menu item and it refuses to work:
on (release) {
_parent.createEmptyMovieClip("container", 1);
loadMovie("about.swf", "container");
container._x = 0;
container._y = 0;
}
I don't think its a targeting issue as I have tested it with other functions and it works I just think there might be a issue withe container name or something.
Has anyone got an idea or solution
3d Menu Loading Images From Xml
hey,
I have been wrecking my brains to work out how I can load images from an xml database to the following bit of code.
PHP Code:
var numItems = 50; // Number of items var focalLength = 1000; // environmental constant var centerX = Stage.width/2; // Stage Center Xvar centerY = Stage.height/2; // Stage Center Ythis.initCamera = function(){ // create camera object this.oCamera = new Object(); this.oCamera.x = 0; this.oCamera.y = 0; this.oCamera.z = focalLength/2; // focal point this.oCamera.dx = 0; this.oCamera.dy = 0; this.oCamera.dz =-focalLength/2; // User screen this.oCamera.s = 30; this.oCamera.t = 0; //time this.onEnterFrame = function(){ // move the camera to its destination with(this.oCamera){ t = (t>=50) ? null : t+1; x = (t>=50) ? x : easeIn(t,x,(dx-x),50); y = (t>=50) ? y : easeIn(t,y,(dy-y),50); z = (t>=50) ? z : easeIn(t,z,(dz-z),50); } } // Zoom back button this._btn.onRelease = function(){ this._parent.oCamera.dx = 0; this._parent.oCamera.dy = 0 ; this._parent.oCamera.dz = -focalLength/2; this._parent.oCamera.t = 0; } // loop and create the numer of instances defined for(var i = 0; i<=numItems;i++){ // attach movie this.attachMovie("instance", "instance_mc_"+i,i); // Assign variable to the MovieClip clip = this["instance_mc_"+i]; // go to a new frame within the clip (randomly chosen) clip.gotoAndStop(random(5)); // Assign variable to the MovieClip clip = this["instance_mc_"+i]; // define initial properties clip.x = random(Stage.width)- centerX ; // initial x position clip.y = random(Stage.height)- centerY; // initial y position clip.z = random(focalLength*2)-focalLength; // initial z position //text on icon clip.nbr_txt.text = i; clip.onPress = function(){ // push the camera towards the word by setting destination just a bit in front this._parent.oCamera.t = 0; this._parent.oCamera.dx = this.x; this._parent.oCamera.dy = this.y; this._parent.oCamera.dz = this.z+this._parent.focalLength*.9; } // render clip.onEnterFrame = function(){ // Calculating current s position according to camera var zpos = (this.z-this._parent.oCamera.z); // Calculating actual scale values according to scale = f/(f+z) formula var scale = this._parent.focalLength/(this._parent.focalLength + zpos); // Make item visible only if scale is smaller than 100% this._visible = (scale <= 10); // set position using camera as an offset this._x = (this.x - this._parent.oCamera.x )*scale + centerX; this._y = (this.y - this._parent.oCamera.y )*scale + centerY; // set size this._xscale = scale*100; this._yscale = scale*100; // set alpha this._alpha = scale*100; // set depth this.swapDepths(scale*100); } }}//return randum integer between two specified parametrers//@param nb1 first random number//@param nb2 second random numberthis.rand = function(nb1,nb2){ return Math.floor(Math.random() * ((nb2 - nb1)+ 1)) + nb1;}this.easeIn = function (t, b, c, d,a,p) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) <= 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;};// Initiate instances in CamerainitCamera(); stop();________________________________________________*/
What i want it to do is load the jpegs into the main mc in the library. Any help would be greatly appreciated.
regards,
Damian
Infinte Menu Loading
Hey.
I have made a webpage in Flash, and used your tutorial for the infinite menu (awesome). However, i'm having trouble making the buttons dynamically load other .swf files. I've made them do it before on other pages, it just seems that the infinte menu doens't like the way I do it. Could someone please help me out,
muchos gracias.
Roy
Loading Slide Menu...
well i've done the slider tutorial, and it works fine...
Heres the link:
http://www.kirupa.com/developer/flash5/slidingmenu.htm
and so i'm loading it using loadmovie, but the thing is, when the file is loaded, the slide thing changes and doesnt' really work properly. You can see in the file attached.
I've tried loading the one you can downloading, and one i've created myself, but they all turn out the same so does anyone know what the problem is? thx...
Loading Dynamic Menu From XML
I'm working on this podcast player (see attached .FLA -- note: it's a CS3-generated FLA), and I've got most of the more simple things setup and ready to go. I've used an old tutorial from here (I believe) to create my scroller action for the list view, but my question would be creating the actual list items dynamically from an XML list. I've been reading all morning about XML parsing and capturing the data. I think once I get to that point, I'll be a-okay, and able to do what I'm looking for, but the more immediate issue is actually "building" the menu list with AS.
I know it's possible with more AS knowledge than I currently have, but I was hoping that someone around here could either give me a hand, or at least give me an idea of what to Google to find what I need.
The structure I'm looking for again is to build a menu of list items, vertically-space them according to my design grid, and have the content for the dynamic text boxes be populated through the XML functionality.
All I really need at this point is for someone to point me the right way, so far as how to learn to script the dynamism of building my list with AS.
Thanks in advance for any input that any of you can provide.
|