Custom Context Menus In Nested Movieclips
The ability to add custom context menus to nested movieclip has supposedly been fixed in Flash 8, but for some reason it just isn't working for me. Is there something that I am missing here:
Code:
for(var i=0; i<100; i++){
var clip:MovieClip = grid_container_mc.grid_mc.attachMovie("box", "box"+i+"_mc", i);
var seatMenu = new ContextMenu();
seatMenu.hideBuiltInItems();
var note = new ContextMenuItem("View Notepad", editNote);
seatMenu.customItems.push(note);
function editNote() {
// do something
}
clip.menu = seatMenu;
}
Thanks in advance for any insight you can provide!
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 12-31-2007, 09:50 PM
View Complete Forum Thread with Replies
Sponsored Links:
Context Menus
Howdy ActionScript genii:
My situation is this:
I have an application that is currently defined by over one hundred eighty ActionScript classes, a server-side API written in PHP, and additional, mostly invisible, functionality written in JavaScript and HTML4. The whole "viewport" aspect of the app and all client-server communication is written in ActionScript.
I'm at the point where the sheer number of features available lends the app toward the advantages of contextual menus. I'm having trouble integrating them, though, and for no particular reason I can isolate.
This is what I'm experiencing:
I'm just going to say, for example, that I have a MovieClip-based object maybe several layers deep in the global arrangement of things. Say it is located at:
_root.document.layer1.documentItem1.button
This represents the mouse event-enabled "button" for the first item in the first layer of a document created with my application. This is just exemplary, and not exactly the way that these things are really arranged, but you get the drift? So this item, documentItem1, could be modified, moved around, etc. and some of the ways that it can be adjusted, I'd like to be able to put in a ContextMenu for the object. I want to attach the menu to the object's "button."
Now, for some reason, I simply cannot get any kind of context menu to apply itself to this object. As far as I know, there are no instances of the ContextMenu object being attached to any of its containing objects. Is there something I'm missing here? I know that a context menu item can be broken if the callback function is invalid, but this is not the case—I have tested this by simply using the hideBuiltInItems() method with no success. Also, I have declared a dummy callback function right in the constructor for the ContextMenuItem with no success.
If I hook the same menu to the root, it works fine, but obviously fails to provide me with any kind of true contextual menus.
If I start a totally blank fla file and begin working with true context menus, I run into no issues. So what is different about this more complicated organism, compared to a simplistic one, that is breaking the ContextMenus?
Does anyone have enough experience with this to suggest some buggies I should look for?
Thanks,
Christopher
View Replies !
View Related
Context Menus
OK, so i thought...i can make a menu when the user right clicks...A Context menu. I created a snazzy orange menu. I made the AS so that when a user right clicks, the movie appears when they click, and when the choose an option, the menu disappears. There are two things on my list:
1) How can you completely disable the context menu. I don't care how, be it software, actionscript, javascript, html or anything.
2) How can i make it so that there is function like "onClickOutside" (i know that isn't a function) where something happens when a user clicks outside the menu (it disappears as well)
Cheers experts,
Flash Cus
View Replies !
View Related
Flash Context Menus
There seems to be a problem when you use spesific keywords in the context menu.
When I use :
selected_menu.customItems.push(new ContextMenuItem("Cut.", folderItemHandler));
selected_menu.customItems.push(new ContextMenuItem("Copy.", folderItemHandler));
selected_menu.customItems.push(new ContextMenuItem("Paste.", folderItemHandler));
It works - note the fullstop at the end of each word, when I remove the fullstop it doesn't even display.
Is this some inbuild way of stopping users from using these keywords themselves?
How can I remove it so that it works.
View Replies !
View Related
Flash Context Menus
There seems to be a problem when you use spesific keywords in the context menu.
When I use :
selected_menu.customItems.push(new ContextMenuItem("Cut.", folderItemHandler));
selected_menu.customItems.push(new ContextMenuItem("Copy.", folderItemHandler));
selected_menu.customItems.push(new ContextMenuItem("Paste.", folderItemHandler));
It works - note the fullstop at the end of each word, when I remove the fullstop it doesn't even display.
Is this some inbuild way of stopping users from using these keywords themselves?
How can I remove it so that it works.
View Replies !
View Related
Context Menus Pre-Flash 7
Ok Flash wizards,
I need to try and prevent the context menu from showing up (so users can't right click and select Play to screw up my project :P )
The only problem is, the movie has to be exported for Flash Player 6 and the ContextMenu class is only available for version 7+
Was there a work-around for this back in the day? Or am I just S.O.L?
View Replies !
View Related
[Flash 8 | AS] Nexting Context Menus
Hey all, I am adding context menus to tree node items. The menus are being created dynamically in AS and I was just wondering if anyone knew a way to nest them.
For example, right now I am having to add:
Add Node Above
Add Node Below
Add Node Inside
I'd like to do:
Add Node
-> Above
-> Below
-> Beside
Not critical, but I'd prefer to do it that way if I can.
View Replies !
View Related
Annoying Flash Context Menus
I've been developing an application that uses context menus to give users most of the control over the interface. I've been creating these context menus using the Flash 2004 Context Menu class, which is great, and makes things really easy.
One niggle, though: the application uses <a href="asfunction: etc."> within textfields to launch pretty much every command that isn't in the context menus, and every time a user attempts to access a context menu near one of these, a Macromedia-generated context menu appears instead with the options 'Copy Link' and 'Show Link'. This is a bit stupid because;
a) the <a hrefs> aren't really links as such, so these options don't do anything anyway
b) They block access to the context menus I've created.
Does anyone know how to suppress these automatic context menus? It's really irritating...
View Replies !
View Related
Modifying Context Menu Of Nested Clips?
I am trying to alter the context menu of a movieclip inside of another movieclip. Although I am able to change the parents menu i cannot change the nested clips menu. If i break apart the parent the child's menu works fine but i need to maintain the parent as a movieclip...
Is there a workaround for changing nested movieclip's context menus?
View Replies !
View Related
Custom Context Menu Help
hi all,
i hv a problem in custom context menu. there is a mc on root named "lbl1". action script on the first frame of scene is:
var lblMenu:ContextMenu = new ContextMenu();
lblMenu.hideBuiltInItems();
var lblCopy = new ContextMenuItem("Copy", copyLbl);
lblMenu.customItems.push(lblCopy);
function copyLbl() {
trace("copy");
}
lbl1.menu = lblMenu;
but this is not showing the "copy" context menu item there. where is the problem? plz help.
View Replies !
View Related
Custom Context Menu
Hi
I just wanna check if there is a way of detecting right click in a particular area(suppose an mc) & display a custom context menu while supressing the flash player menu? I know that it can be done in FlashMX 2004 but that only adds menu items to the flash player menu.
While what I want is to supress the flash player menu so that it is not displayed & a custom menu of mine(an mc) is displayed.
Any one??
View Replies !
View Related
[F8] Custom Context Menu Question
When creating a custom context menu, can you have an item that contains a submenu?
For example, could I have an item labelled "Detail" that when you rolled over it, revealed a submenu with "High", "Medium" and "Low" as items.
If you still don't know what I mean, go on File > Open Recent...
It has that arrow next to the words "Open Recent" and reveals a submenu when you rollover it.
Any help would be much appreciated.
Thanks
View Replies !
View Related
Custom Context Menu Not Showing Up
Hi,
I have set a custom context menu in a .swf, and I can see it normally when previewing it on flash (Test Movie).
However, when I see it on my browser, I can't see the custom options (only the reduced context menu with settings and about macromedia...)
On my first frame I have an actions layer with this (context + loader):
ActionScript Code:
root_cm = new ContextMenu();root_cm.hideBuiltInItems();root_cm.customItems.push(new ContextMenuItem("Add to Favourites", itemHandler1))root_cm.customItems.push(new ContextMenuItem("send e-mail", itemHandler2));;function itemHandler1(obj:Object, item:ContextMenuItem) {getURL("javascript:window.external.AddFavorite(location.href, document.title);");}function itemHandler2(obj:Object, item:ContextMenuItem) {getUrl("<a href="mailto:emailIwant@domain.com">mailto:emailIwant@domain.com</a>", "_parent");}_root.menu = root_cm; bytes_loaded = Math.round(this.getBytesLoaded());bytes_total = Math.round(this.getBytesTotal());getPercent = bytes_loaded/bytes_total;this.loadBar._width = getPercent*307;this.loadText = Math.round(getPercent*100)+"%";if (bytes_loaded == bytes_total) {this.gotoAndPlay(3);}
(corrected the mailto command)
which setting may be wrong so that it won't work ?
View Replies !
View Related
Problem With Custom Context Menu (Flash CS3/AS3)
I am attempting to implement a custom context menu in a Flash CS3 and ActionScript 3 project.
PROBLEM: The context menu displays and functions properly when testing the movie in Flash CS3 but does not display at all when viewing through my website (IE7 or Firefox).
Has anybody seen this before?
Here is a sample of some of the code I'm using. The context menu is created inside of the class where I have a few display objects.
public class MyClass
{
protected var m_ContextMenu:ContextMenu;
function MyClass()
{
//--- Build Context Menu
m_ContextMenu = new ContextMenu();
var item:ContextMenuItem = new ContextMenuItem("TestItem");
m_ContextMenu.customItems.push(item);
item.addEventListener(ContextMenuEvent.MENU_ITEM_S ELECT, menuItemSelectHandler);
m_ContextMenu.addEventListener(ContextMenuEvent.ME NU_SELECT, menuSelectHandler);
}
protected function menuSelectHandler(event:ContextMenuEvent):void
{
trace("menuSelectHandler: " + event);
}
protected function menuItemSelectHandler(event:ContextMenuEvent):void
{
trace("menuItemSelectHandler: " + event);
}
}
View Replies !
View Related
[fmx2k4] Custom Context Menu Limitations
Just playing around with some of the new FMX2k4 features, specifically the ContextMenu() and ContextMenuItem() stuff.
Perhaps unsurprisingly you cannot have custom elements with the same labels as any of the built-in items ("Show All", "Zoom 100%", etc). These are case-insensitive too.
That's fair enough, but it seems that you cannot have custom menu items with the labels "cut", "copy" or "paste" (add any other characters besides a space and they work fine, eg: "cut_", "copy_").
Here's my code:
ActionScript Code:
/* DOESN'T WORK */
var my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
my_cm.customItems.push( new ContextMenuItem("copy",f_one) );
my_cm.customItems.push( new ContextMenuItem("paste",f_two) );
function f_one() { trace(" f one ") }
function f_two() { trace(" f 222 ") }
this.menu = my_cm;
/* WORKS GREAT */
var my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
my_cm.customItems.push( new ContextMenuItem("copy_",f_one) );
my_cm.customItems.push( new ContextMenuItem("paste_",f_two) );
function f_one() { trace(" f one ") }
function f_two() { trace(" f 222 ") }
this.menu = my_cm;
Anyone know why this might be? There are no current cut/copy/paste items but might they be getting added in at some point? Can anyone find any other disallowed menu labels?
View Replies !
View Related
Flash Custom Context Menu Not Displaying In Website
I am attempting to implement a custom context menu in Flash CS3 (ActionScript 3). I am using Bewise's FlashControl to display the swf in my ASP.NET 2.0 website.
The example I provide below works fine for the following:
- Running from within Flash CS3 (Test Movie)
- Publish Preview from Flash CS3 (both using Player 9 and straight HTML... IE7 and Firefox)
It simply will not display the custom context menu item when running in my ASP.NET website (both from within VS2005 debug environment or fully published website).
Has anybody seen this before?
Sample Code
In my .fla file I do do the following:
var cm:ContextMenu = new ContextMenu();
var item:ContextMenuItem = new ContextMenuItem('Test Item');
cm.customItems.push(item);
MyMovieClip.contextMenu = cm;
View Replies !
View Related
FLVPlayback Custom Context Menu Fullscreen Hit Area
In my video player application I have added a custom context menu. When in normal display state the custom context menu appears when you right click anywhere in the player as it should. When in fullscreen state the custom context menu only shows up if you right click inside the fullscreen text and if you allow the fullscreen text to fade out by mouse out the only menu you can get is the default. I have tried to assign the custom context menu to every possible display object, inside the fullscreen text is the only area it shows up while in fullscreen mode.
I have also tried the more common format for adding context menu items however this one is less code.
public function addContextMenu():void
{
myContextMenu = new ContextMenu();
myContextMenu.customItems.push(new ContextMenuItem("Go Full Screen"));
myContextMenu.customItems.push(new ContextMenuItem("Exit Full Screen"));
myContextMenu.hideBuiltInItems();
myContextMenu.customItems[0].addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,onShowFullScreen);
myContextMenu.customItems[1].addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,onShowNormalScreen);
application.contextMenu = myContextMenu;
}
Any incite would be welcome.
Thank you
Greg
View Replies !
View Related
Target Movieclips From Nested Movieclips...
All,
I was wondering if you could give me a hand?
I have a file that contains two movieclips. One movieclip contains a container clip and the other movieclip contains two nested movieclips which end up with a button. Please see diagram...
I would like for the button, when clicked, to load an external .swf file into the container movieclip which is nested inside a _root movieclip. See diagram...
I have used the following code on my button to no avail:
Code:
loadMovie("Flash/homeIMGs/image1.swf", _root.mainImageMC.imageMC);
AND
_root.mainImageMC.imageMC.loadMovie("Flash/homeIMGs/image1.swf");
Please help.
View Replies !
View Related
Animating Menus, Movieclips, Objects Etc.
I want to build a homepage to showcase some of my flash work and I want it to be animated. I've had prblems doing this however. How would you make it so that MovieClips could move across the stage according to a function, and stop when they've arrived, but they can be told to move again later. I want to control everything 100% from the _root code, and I think the best way to do this would be to attachMovie() and then load that with code including onEnterFrame = function. My problem is however, what if I want it to be moving according to two functions simultaneously, and for each function to end independant of when the other one ends. If I say onEnterFrame = null, then both stop. Am I going the right way to accomplish what I want? or should I do something else? Thanks in advance.
View Replies !
View Related
Problems About Menus With Duplicated Movieclips
i dowload menus like: 3d spiral menu, from ultrashock an locks very nice but this kind of menus are maded with only one movieclip duplicated so how i can use that kind of menu? i cant change text or urls because the same change will be in all the elements, or may be i am loosing something, any idea?
View Replies !
View Related
[F8] Nested Movieclips
Hi,
I am trying to make an app and i am having no luck at all.
A picture is on the left and is created by several possible images so i have made it up from several movie clips.
I have also got a menu with a series of buttons on the right and used movie clips there as well for the different sets of buttons.
The problem i am having is nothing i do to code it works, please help.
I am using Actionscript 2.0 and Flash CS3
Thanks in advance
View Replies !
View Related
Nested MovieClips
Hi i first and foremost would like to say thanks in advance to anyone who are reading this.
Basically I'm Starting out on a project where i whant a bird to randomly move on the stage. but i want the forward propulsion to be linked to how the movement of the wings. So heres what i have set up for now. I got the wings ( mcRightWing and mc LeftWing nested inside mcBird) I want the bird to randomly move both in direction and speed therefore Im using Math.random to controll the rotation of the wings ( we are looking at the bird from above like in the old games)
But im getting ahead of myself here. I need a way of controlling the wings, meainge i want the left and right wing the mirror each others movment. Any suggestions for how that function would look like?
Thanks
View Replies !
View Related
Nested MovieClips
one more question. i have a movieclip and i attach another movieclip INSIDE the first one. i want the second movieclip to be equally spaced and centered in the first one. how do i do that? is it somehting 2 do with registration point??
and when i change the size of the clips, i want the size of the child to change with the parent? can anyone gimme a hint!
Thanx for ur help.
i'm very new to flash n m working on AS2.0 class architecture. so, u can say that i'm not a graphics guy.
View Replies !
View Related
Nested Movieclips?
So I'm trying to simply nest some MCs and draw some squares within the nested clips.
Code:
nextDepth = this.getNextHighestDepth();
this.createEmptyMovieClip("mainMenu",nextDepth);
mainMenu.createEmptyMovieClip("menu1",nextDepth);
mainMenu.createEmptyMovieClip("menu2",nextDepth);
mainMenu.menu2._x = 250;
mainMenu.menu1.moveTo(0,0);
mainMenu.menu1.beginFill(0x000088);
mainMenu.menu1.lineTo(100,0);
mainMenu.menu1.lineTo(100,100);
mainMenu.menu1.lineTo(0,100);
mainMenu.menu1.endFill();
mainMenu.menu2.moveTo(150,0);
mainMenu.menu2.beginFill(0x000088);
mainMenu.menu2.lineTo(250,0);
mainMenu.menu2.lineTo(250,100);
mainMenu.menu2.lineTo(150,100);
mainMenu.menu2.endFill();
This is just my first step in a build and I wanted to test that the movieclips were nesting properly. The problem isn't the squares but that the first movieclip isn't displaying. And when I comment out the second MC (menu2) it displays fine.
If anyone would point how what I'm doing wrong or send me in the right direction with a tutorial, that would be wonderful.
View Replies !
View Related
Nested MovieClips
one more question. i have a movieclip and i attach another movieclip INSIDE the first one. i want the second movieclip to be equally spaced and centered in the first one. how do i do that? is it somehting 2 do with registration point??
and when i change the size of the clips, i want the size of the child to change with the parent? can anyone gimme a hint!
Thanx for ur help.
i'm very new to flash n m working on AS2.0 class architecture. so, u can say that i'm not a graphics guy.
View Replies !
View Related
Nested Movieclips
Code:
for (e in _root.images)
{
var f4:Fuse = new Fuse();
f4.push({_alpha:100, time:1.5, delay:count,ease:"easeInQuad"});
f4.target = _root.images[e];
f4.start();
count++;
}
i am using this code to fade in other clips one by one. it works great other than the fact it does it backward. any way to switch the order of an "in" statement?
View Replies !
View Related
Nested Movieclips
How is it possible to create moviclips with addchild() and removechild() methods??
I wanted to create a an animation such that the man walks to the door and when he reaches there the door disappears and the people are seen.
Anyone please suggest the code
View Replies !
View Related
Nested MovieClips
In some ways, I hope the answer to this problem is trivial, but on the other hand I don't want to annoy the moderators.
Our study group is creating a virtual photo album that can have photos dragged into it. This is a non-web Flash app.
The idea is to have a Page object that has Photo objects dragged into it. Everything has to be a MovieClip becuase they all need to be draggable.
I figured we could have a Page object that extended MovieClip and that it would contain nested MovieClips (which are the photos). However I'm finding it a mission to dynamically create the Photo objects.
In the library I have a Page mc and a Photo mc where the Page mc is linked to Page .as. The Photo mc is just a box for now.
This is a simplified version of it.
Code:
class Page extends MovieClip {
private var _photo1:MovieClip;
function Page(){}
public function addPhoto(){
trace("Adding Photo");
_photo1.attachMovie("Photo", "photoInstance", 2);
}
}
So I'm trying to create/instantiate the Photo mc with _photo1.attachMovie("Photo", "photoInstance", 2); and I've tried numerous variations of it. All the tuts I've stumbled across get close, but not quite close enough. The closest I've gotten is here
I instantiated the initial page object on the main timeline with
Code:
var leftPage = this.attachMovie("Page", "pageInstance", 1);
leftPage.addPhoto();
Later on this is meant to load/save to XML and have multiple photos. That seems a long way off.
Cheers for any help
View Replies !
View Related
3rd Tier Nested Custom Mc Button Being Ignored
I'm having the worst trouble understanding something here. I have followed all the instructions to work a scrolling thumbnail photogallery using this tutorial.
http://www.youtube.com/watch?v=2TrIQ...eature=channel
I have completely converted it over to AS 3.0 in the most logical way I can think to do it. Here is the script I am using to make this thing work.
Code______________________________________________ ___________
stage.addEventListener(MouseEvent.CLICK, thumbClicked);//This is a tester modification
/*TN002.buttonMode=true;//This is a tester modification
TN002.addEventListener(MouseEvent.ROLL_OVER, thumbClicked);//This is a tester modification*/
//This is the real code
TNBar.TNBarInside.TN001.addEventListener(MouseEven t.CLICK, thumbClicked);
TNBar.TNBarInside.TN002.addEventListener(MouseEven t.CLICK, thumbClicked);
TNBar.TNBarInside.TN003.addEventListener(MouseEven t.CLICK, thumbClicked);
var frameNum:Number=1;
var selfRun:Timer = new Timer (5000);
selfRun.addEventListener(TimerEvent.TIMER, selfRunHandler);
function selfRunHandler (evt:TimerEvent):void{
frameNum = frameNum + 1;
this.Sketches.gotoAndStop("IMG"+frameNum);
this.Sketches.Cover_Intro.play();
}
selfRun.start();
function sketchChange(){
this.Sketches.gotoAndStop("IMG"+frameNum);
function thumbClicked (event:MouseEvent):void{
if (event.target == this.TNBar.TNBarInside.TN001) {
frameNum = 1;
sketchChange();
}
if (event.target == stage) {//I have done this to test if everything
this.Sketches.Cover_Intro.play();//works via the 2nd button
frameNum = 2;
sketchChange();
}
if (event.target == this.TNBar.TNBarInside.TN003) {
frameNum = 3;
sketchChange();
}
}
End Code______________________________________________ _
On another mc I have the pictures organized with frame labels. I know that they all work correctly because the selfRun function that I created to make the images progress every 5 seconds works perfectly. Also when I add an even listener for the stage and set it to work as the 2nd button should, the functions work fine - image movie clip goes to the frame label for the 2nd image. Additionally when I change the event listener for the 2nd button from a MouseEvent.CLICK to a MouseEvent.ROLL_OVER - IT WORKS COMPLETELY FINE!? But these darned things just dont seem to want to work as plain buttons. I thought it was an issue of being nested inside over 3 other movie clips, but like I said the roll over tests have proven other wise. And its not a function error because then I make the listener for the stage it works. Also when I add a new instance of just the movie clip custom thumbnail button onto the main stage directly and set up the listeners correctly, it STILL will not be recognized by a CLICK listener, YET still works as a ROLL_OVER listener. Although the movie has 55 thumbnails total and coping the bar that has them exceeds Flashes workspace limitation - this thing goes for miles off of the stage to a point where it wont allow me to set an x position of 0.0 LOL! - I don't think this is preventing the button from being recognized considering all of my tests have worked. What Am I doing wrong?
Any help you can provide would be great - thanks so much.
View Replies !
View Related
Nested MovieClips & TellTarget
Gottta question... I have a movieclip thats has buttons in it that is within another movieclip in my scene. I am running TellTarget in the first movieclip, and am having trouble targeting from the nested movieclip back out to the first. I know it's a naming problem, but I don't know what.
BTW, for example, the first TellTarget calls "/theclipname"... How do I make a button in the second movieclip target the same?
View Replies !
View Related
Preloading Nested MovieClips
http://www.7inone.info/sid/
ok that's the site I'm looking at - so far so good, but I wanna add preloaders to each child movieclip.
this is how it works:
I have my main movie (main.swf). On frame one, the background movie (bg.swf) is loaded into level0. When bg.swf reaches a certain frame (the end of the animation) it loads all the other little movies (right_nav.swf, left_nav.swf, etc.) into various MC holders in main.swf.
so I'm trying to make a preloader for bg.swf - because it's the largest .swf file, and takes a while to load. Scene 1 of bg.swf is all of one frame long - into which various MCs are placed. I make another Scene, and call it preloader - it comes before Scene 1, and that's where I'm stuck. I use "ifFrameLoaded". But the frame I'm trying to target is found like this:
Scene 1 - Stargroup - Frame70.
what's the scripting???? please help!!!! I'm Desperate!!!
thanks a bunch
sid.
View Replies !
View Related
Nested Resizing Movieclips
I have gotten myself in a muddle .
What I want to do is the following:
Have a movieclip on stage ("main_mc" 600x300pixels)
This contains several instances of a second movieclip ("plotArea_mc" 250x100). I can resize and reposition these instances individually.
The movie clip "plotArea_mc" contains two further movie clips "past_mc" and "future_mc" (100x100 each and positioned side by side). The crucial bit is that the past and future movieclips must resize themselves automatically if I change the size and position of their parent "plotArea_mc" instance.
The purpose of this structure is that I have several series of bitmaps.
past_A_01.bmp, past_A_02.bmp, past_A_03.bmp etc.
past_B_01.bmp, past_B_02.bmp, past_B_03.bmp etc.
etc.
etc.
future_A_01.bmp, future_A_02.bmp, future_A_03.bmp etc.
future_A_01.bmp, future_A_02.bmp, future_A_03.bmp etc.
etc.
etc.
I want to use these bitmaps as frames for diferent animations. I want to house my animations in pairs (one past animation and one future animation) in the variouse instances of the "plotArea_mc" movieclip.
So the individual animations are actualy housed in the various instances of the "past_mc" and "future_mc".
Finaly, I am not big on actionscript, so I am planning to drop all the bitmaps in manually. So its best if the movieclips are accessible, rather than apearing at runtime.
If anyone thinks this is doable, could you build this structure of autoresizing movie clips and post it. It probably sounds very cheaky, but I have been banging my head against this problem all night.
Thank you in advance.
Tim.
View Replies !
View Related
Targeting Nested Movieclips?HELP
I have a movieclip(hmov) inside a scrolling movieclip (harcourt) . On the main stage I have buttons which scroll the movieclip(harcourt) in a portfolio style window which is under a mask.
the problem is when you click on the button to go to that part of the portfolio the movieclip(hmov) starts playing. I want it to play when you click the number button that corresponds with the second page.
I'm unable to target the movieclip within the movieclip and I'm noot even sure how to make it wait until it's loaded under the mask?
http://www.glowdesignhouse.com/glowweb8.31.html
go to portfolio then harcourt-you can see the movieclip on button 3 loaded into level in the wrong place
It's been three days of trying loading, visibility ,container clips, I'm just not script savy enough to figure it out on my own-YET
thanks a bazillion
View Replies !
View Related
Function Ignored With Nested MovieClips
allright another crazy problem that's already taking me 2 hours. I have a pretty big project, but in a test environment I narrowed it doen to the following.
On de _main timeline, first frame:
Code:
_root.attachMovie("First","first", 1 );
I create 2 movieclips (First and Second) and set the linkage as 'export for actionscript', and 'export in first frame'.
code in First:
Code:
this.attachMovie("Second", "second", 1);
second.attachMenuItem("thumbs/mountwossname.jpg");
code in Second:
Code:
this.attachMenuItem = function(img){
trace("img "+img);
}
clearly, what I would suspect is that "img thumbs/etc" is printed in the output. Nothing happens. Now the really weird part is that when I add the function from Second to First, so the code of first becomes:
Code:
this.attachMovie("Second", "second", 2);
this.second.attachMenuItem1 = function(img){
trace("img "+img);
}
second.attachMenuItem1("thumbs/mountwossname.jpg");
this does work. Can anyone help me out coz this is driving me crazy. Thanks!
View Replies !
View Related
Date In Nested Movieclips
I am implementing a date display, which works fine when used on the main timeline. My problem is that I have several mc's throughout and I only need the date display on a specific mc. When placed in there with the current code it doesn't work. I also have changed it to make sure the correct targeted mc is listed (ex _root...) and it still doesn't display. Is this something that is not capable or could someone please advice? There are three text fields in an mc titled 'callen'. This mc is in another mc 'pg0', which is in another mc named 'mc'. Each dynamic text field has an instance name and variable name. I know ther isn't anything wrong with the code since it works on the main timeline, it just isn't passing the variables into the many nested mc's. I hope I haven't confused you. Here is my AS.
This is on the MC
Code:
onClipEvent (load) {
days = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
months = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
timedate = new Date ();
}
onClipEvent (enterFrame) {
todaydate = timedate.getDate();
day = timedate.getDay();
dayname = days[day];
month = timedate.getMonth() + 1;
monthname = months[month - 1];
year = timedate.getFullYear();
currentdate = (((todaydate + "/") + month) + "/") + year;
+ year;
bookday = todaydate; //tried this as well _root.mc.pg0.callen.bkdy.book.day = todaydate;
bookmonth = monthname; //similar to line above
bookweek = dayname; //similar to line above
delete timedate;
timedate = new Date ();
}
//*and on a blank keyframe where last mc (callen) is located*//
getCurrentDate = function () {
myMonths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
myDate = new Date ();
myMonth = myDate.getMonth();
myDay = myDate.getDate();
myCurrentDate = (myMonths[myMonth] + "_") + myDay;
};
getCurrentDate();
Nothing is displayed no matter which version. I feel it is close and I hope someone could help.
View Replies !
View Related
HitTest With Nested Movieclips
I'm having a bit of trouble getting hitTest to work. I've got a movie clip inside another movie clip trying to check for a hitTest with a movie clip on the _root timeline, and nothing seems to happen. Here's the code I have on the timeline of the movie clip I want to hitTest.
onEnterFrame = function()
{
if (this.hitTest(_root.circlei))
this.removeMovieClip();
}
(circlei being the instance name of the movie clip on _root that this symbol is to collide with)
I've attached the file for your viewing pleasure
thanks
View Replies !
View Related
Nested Movieclips Not Playing
OK, I have a problem with nested animated movie clips not playing.
I have an animated movieclip that contains four buttons. When you rollover the movieclip, it ‘expands’ and the buttons are accessible. When you rollout off the movieclip, the animation reverses. When you rollover the buttons, there is an animated movieclip (overstate) that should play, but they don’t.
Here is the script for the movieclip on the main timeline:
PHP Code:
stop();
var expand:Boolean = false;
dropDown_mc.addEventListener(MouseEvent.MOUSE_OVER, contact);
function contact(myevent:MouseEvent):void {
expand = true;
}
dropDown_mc.addEventListener(MouseEvent.MOUSE_OUT, outside);
function outside(myevent:MouseEvent):void {
expand=false;
}
stage.addEventListener(Event.ENTER_FRAME, continousAction);
function continousAction(myevent:Event):void {
if (expand == true) {
dropDown_mc.nextFrame();
} else {
dropDown_mc.prevFrame();
}
}
Why would the above script prevent the overstate animated MC from playing? If I create a movieclip with the same four buttons without any script attached, the overstate plays as it should. The script attached to the buttons work, the only problem is the overstate does not play.
View Replies !
View Related
[cs3] Can Anyone Help - Problem With Nested Movieclips
Please help!!!
I have a movieclip symbol, let's say, of a ball bouncing with a stop(); action on frame 14.
And I have another movieclip symbol that has some text moving across the screen with a stop(); action on frame 10.
On the main time line, I'd like the ball to start bouncing on frame 2 and stop on frame 15, so I've placed it on its own layer with a keyframe on frame 2.
I want the text symbol to start on frame 6 and stop on frame 15 also, so I've placed it on its own layer with a keyframe on frame 6.
This doesn't work.
When I play it back, the visual skips wildly back and forth between the symbols.
What do I do??
I'm working in Adobe Flash CS3. ActionScript 3.0, 30 fps, Player 9 (don't know if any of that is relevant, but just in case).
Please help me, I'm desperate, I can't figure it out.
Thank you!
View Replies !
View Related
Hittest With Nested Movieclips
I have a lot of nested movie clips. For some reason someone at one point told me it was a good idea.
I can't seem to get hittest to work. Any help is appreciated... Can you even hittest movies clips inside different movie clips?
This is my code:
Code:
for(var x=0;x<=5000; x++){
if(this.hitTest(_root.jet, _root.environment_mc.environment.bombSpawn_mc.flying_mc.bigBomb_mc)) {
trace("Collision Detected");
} else {
trace("No Collision");
}
};
View Replies !
View Related
Blurring Nested Movieclips?
Basically I created a empty movieclip, which I then attach an existing movieclip(containing several movieclips I want blurred). I did get this working one time, but of course Flash crashed before I could save the recent changes, and for some reason I can't get my success to repeat itself.
Code:
//Creating the containerMC and then attaching as well as positioning movieClips_mc
_root.createEmptyMovieClip ("stageBG_mc", this.getNextHighestDepth());
_root.stageBG_mc.attachMovie("movieClips_mc", "movieClips_mc", this.getNextHighestDepth(), {_x:-711.5, _y:-924.7});
//Blurfilter on
var myBlur= new flash.filters.BlurFilter(250,250,3);
var myFilter:Array = _root.stageBG_mc.movieClips_mc.UpperLeft_mc.filters;
myFilter.push(myBlur);
_root.stageBG_mc.movieClips_mc.UpperLeft_mc.filters = myFilter;
Yet I cant get it to work, the linkage is correct on the existing movieclips. Any thoughts on what i've missed?
View Replies !
View Related
Nested Movieclips With Same Mask
hi guys I really need some help for this:
How can I use the same mask for two nested movieclips (one of the movieclips is inside the other one).
When I mask the first movie, the one which is nested simply disappears....and if I try to use setMask for the second movieclip which is inside the first one, then the Mask works fine on the second but not anymore on the first.
Is that some kine of rule, that a mask can mask only a single movieclip???
If yes is there anyway to cheat or bypass this rule???
Thanks
View Replies !
View Related
TextField Nested Within MovieClips.
I'm having an issue with some dynamically created textField objects. The entire code is rather convoluted and long, but the bit I'm having trouble with is this:
Code:
getPage=function()
{
/*first, delete the previously loaded page, if any*/
delete(pageHolder_mc.page_mc);
/*then create it again*/
pageHolder_mc.createEmptyMovieClip("page_mc",0);
with(pageHolder_mc.page_mc)
{
/*this bit references some arrays and objects that I built from my XML file.
I'm confident this part works, an the debugger bears that out*/
if(sections[currentSection].pages[currentPage].external==false)
{
/*I set the value of the leading between objects. I may use htmltext
for this later, but for now, this appears to be working*/
textHeight=20;
/*this loop determines how many textFields should be created on the page*/
test=sections[currentSection].pages[currentPage].pageItems.length;
for(var i=0;i<test;i++)
{
/*create a unique name for each textField... debugger confirms this works*/
var newText_txt=["text"+i]
/*create the textField. Debugger also confirms this works*/
createTextField(newText_txt,i,150,125+textHeight*i,600,textHeight);
/*this is the problem right here. It doesn't actually update the .text
variable in the Text Field Object. Debugger shows .text as an empty
string "". Tracing the value returns the expected results, and not an
empty string, which leads me to believe that I'm not accessing the
text field properly, though I can't understand how I'm doing it wrong.*/
newText.text=sections[currentSection].pages[currentPage].pageItems[i].itemText;
trace(sections[currentSection].pages[currentPage].pageItems[i].itemText);
}
}
}
}
is there some problem with a textField object being created in two nested movieClips? Am I accessing my textField objects incorrectly? I'm very close to making this project actually functional, and I'd like to be able to show some progress tomorrow. Please let me know if you have any ideas.
View Replies !
View Related
Confused By Nested Movieclips
Hi, I'm new to AS3, but not to programming or OOP. However, AS3 and it's displayobjects seem to be confusing me alot. I'm trying to make a very simple game for my own learning purposes, but can't seem to get the movieclips to play correctly in AS3. I saw some AS2 examples, but they dont seem to transfer well to AS3.
Here's the Code:
Code:
hero.step=2;
hero.attack = false;
hero.stance= 1;
var rightDown:Boolean = false;
var leftDown:Boolean = false;
var spaceDown:Boolean = false;
var keySpace = false;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
var timer:Timer = new Timer(20);
timer.addEventListener(TimerEvent.TIMER, moveClip);
timer.start();
function keyDownListener (e:KeyboardEvent):void
{
if(e.keyCode==Keyboard.LEFT)
{
leftDown=true;
}
else if(e.keyCode==Keyboard.RIGHT)
{
rightDown=true;
}
else if(e.keyCode==Keyboard.SPACE)
{
spaceDown=true;
}
}
function keyUpListener (e:KeyboardEvent):void
{
if(e.keyCode==Keyboard.LEFT)
leftDown=false;
if(e.keyCode==Keyboard.RIGHT)
rightDown=false;
if(e.keyCode==Keyboard.SPACE)
spaceDown=false;
hero.gotoAndStop("stance");
}
function moveClip (e:TimerEvent)
{
if(leftDown)
{
hero.scaleX = 1.0;
hero.stance=0;
hero.x-=hero.step;
if(hero.currentLabel != "walkingleft")
hero.gotoAndStop("walkingleft");
}
if(rightDown)
{
hero.scaleX = -1.0;
hero.stance=1;
hero.x+=hero.step;
if(hero.currentLabel != "walkingleft")
hero.gotoAndStop("walkingleft");
}
if(spaceDown && keySpace==false)
{
hero.attack = true;
}
if(hero.attack)
{
if(hero.currentLabel != "attackleft")
{
hero.gotoAndStop("attackleft");
}
if(hero["nestAttackLeft"] != null && hero["nestAttackLeft"].currentFrame == 11)
{
hero.attack=false;
}
}
if(spaceDown)
{
keySpace= true;
}
else
{
keySpace = false;
}
e.updateAfterEvent();
}
What I'm trying to do is make the hero move across the screen whenever I press left or right on my keyboard and at the same time have it play the walking animation that is nested in hero_mc. I've got the walking down with some help from mazoonist, but not the attacking animation.
When I press space the hero's attack animation plays non-stop. I checked hero_mc.attack and it is set to false after the last frame of the attack animation is played. This makes no sense to me in terms of logic. Perhaps there's something to AS3 that I don't quite understand?
Also, if you have tips for me to improve the above code please tell me.
Thank you.
View Replies !
View Related
Taget All Nested Movieclips?
Is there a way to target all nested movieclips with a wildcard? I'm trying to write something like this:
Code:
function bt_show_shop(event:MouseEvent):void {
MovieClip(this.root). mc_nav_right.tl_shops.mc_shops_ani.mc_showhide_shops.gotoAndStop(2);
MovieClip(this.root).mc_maps.mc_map_terminala.mc_dots.bt_dot_shop*.visible = true;
}
MovieClip(this.root).mc_nav_right.tl_shops.mc_shops_ani.mc_showhide_shops.bt_show.addEventListener(MouseEvent.MOUSE_UP, bt_show_shop);
or this:
Code:
function bt_show_shop(event:MouseEvent):void {
MovieClip(this.root). mc_nav_right.tl_shops.mc_shops_ani.mc_showhide_shops.gotoAndStop(2);
MovieClip(this.root).mc_maps.mc_map_terminala.mc_dots.*.visible = true;
}
MovieClip(this.root).mc_nav_right.tl_shops.mc_shops_ani.mc_showhide_shops.bt_show.addEventListener(MouseEvent.MOUSE_UP, bt_show_shop);
but the * doesn't work.
I have a lot of movieclips that all have an instance name bt_dot_shop1, bt_dot_shop2, etc. and don't want to have to manually target each one.
Thanks!
View Replies !
View Related
UseHandCursor In Nested MovieClips
I'm making this website and I'm trying to make the hand cursor appear over my buttons (well they are actually movieclips) that are nested within another movieclip on the main timeline. The movieclip links on my main timeline work fine, and are controlled by script in a separate class with the following code:
package {
import flash.display.MovieClip;
class ClickableMovieClip extends MovieClip {
function ClickableMovieClip():void{
this.buttonMode = true;
this.useHandCursor = true;
}
}
}
if I hook up my nested buttons to this it gives me this error:
1046: Type was not found or was not a compile-time constant:mPortfolioThumb0
I then I tried putting script on my main timeline because thats how I got these buttons to function (as opposed to my main timeline buttons which are in a separate class)
function ClickableNestedMovieClips(evt:Event):void {
this.mPortfolioThumb[i].buttonMode = true;
this.mPortfolioThumb[i].useHandCursor = true;
}
- 1119: Access of possibly undefined property mPortfolioThumb through a reference through static type Website.
function ClickableNestedMovieClips(evt:Event):void {
mHeader1.mPortfolioThumb[i].buttonMode = true;
mHeader1.mPortfolioThumb[i].useHandCursor = true;
}
this one didnt give me any errors but still doesn't work....
sorry this is ridiculously long...wanted to cover everything...please help!
View Replies !
View Related
Cannot Access Nested Movieclips
I have a MovieClip called "myContainer" added to the main timeline during runtime. myContainer has 3 frames on it's timeline. In each frame are 3 different buttons with the instance names "btn1", "btn2", "btn3".
With myContainer on frame 1, I can't access btn2 or btn3
ActionScript Code:
//on the main timeline
var myContainer:container = new container();
addchild(myContainer);
trace(myContainer.btn1); //traces [object SimpleButton]
trace(myContainer.btn2); //traces null
trace(myContainer.btn3); //traces null
With myContainer on frame 2, I can't access btn1 or btn3
And so on...
This is very annoying when I need to add event listeners to the buttons. The code needs to be in the main timeline so I can later do a removeChild(myContainer) with one of the button events.
Any ideas on how to deal with this?
View Replies !
View Related
LocalToGlobal... Nested MovieClips
Hello everyone
I'm very sorry, but I just need to confirm one thing regarding this "localToGlobal" thing. I think I'm using it correctly, but I just doesn't make the change I expected in the coordinates...
It's this simple:
I have created in flash two types of MovieClips (lets call them "McA" and "McB", standing for apples and bananas I then placed instances (about 20 or so) of these movieClips on the stage (in my .fla file) to check the exact coordinates. And finally I selected all of them and created a new symbol (lets call him McF, as in for Fruit).
Now, instead of repeating 20 times the word "addChild" I just added the Mcf.
So, (let me see if I got it right...) now there are so far nothing less then 3(!) coordinate systems: one for McA (level 2), other for McF (level 1), and other for the Stage (level 0), in terms of hierarchy...
Of course I now want to retrieve the coordinates of one of those instances (lets say "a1", which is (I think it is...) an instance of an instance of McF:f1) on the stage.
from what I've read, this:
var pt1:Point = new Point(f1.a1.x, f1.a1.y);
pt1 = f1.a1.localToGlobal(pt1);
should work. But it doesn't. To be more specific, a1 inside f1 is at (428,338); in the stage it should be at (478,520) and after the localToGlobal it's at (1009,798)!
Could anyone shed some light on this nesting and retrieving things...
Tks in advance!
Yantis.
View Replies !
View Related
|