Playing Frames Inside A MC Inside A MC That Is Inside A MC
much like the title says. how do i put code in the main timelinesuch as gotoAndPlay(x) x refering to a a frame inside a MC inside a MC. thx for any help
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 03-19-2007, 08:38 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Playing Frames Inside A MC
I want to make an action to a frame that when i press SPACE a MC changes from frame 1 to frame 5 for example.
in frame on of the scene comes the movieclip. I edit the mc so that there are 5 frames each one is different. I put stop () in each of the mc´s frames.
Now to the frame where the mc is located in i put the actionscript:
if (Key.isDown(Key.SPACE)){
//here comes the code that makes the mc go to frame 5 inside the mc. get it?
}
help!
Tweening External Dynamic Text Inside A MC Inside Main Timeline
I've seen a hundred and a half posts on similar subjects, but goshdarnit, I just can't make this work. Let me explain the problem, and I've included a link to a Zip file with my .fla file and the away.txt file I'm calling the variables from.
Basically, I want to create an interactive menu thing, that starts with a row of each of the 26 letters of the alphabet. When one clicks on a letter, the letter is tweened to a larger faded state, and so is the rest of the alphabet, and I want the names of the schools starting with that letter to then fade in. I have a movie clip inside the last frame of the main tween, which should then tween (fade in over 12 frames) the graphic symbol containing my dynamic text box, which is supposed to be linked to the text variables in the external file. The text variable is created on the first frame of the main timeline using Actionscript on the static header layer, and so I should be able to load it inside my movie clip (I think). Everything looks fine to me, but then I've only been using Flash for 2 weeks.
To sum up, I need to tween the graphic symbol. The graphic symbol contains the dynamic text which references the external text file. The graphic symbol is inside a movie clip, inside one frame of my main timeline. The text isn't showing up, only the empty text box is.
My Zipped source files can be found at: http://www.tolcs.org/athletics/away.zip
If anyone would be willing to download my source files and give some wonderful advice, I'd revere and adore them forever.
Button Inside Movie Clip Inside Scrollpane Doesn't Work In Xml
This is sorta odd but I'm hoping somewhat easy to fix. This is in AS2 and is the last problem I have in a very small project of mine.
I have button called button01 inside a movieclip called movieclip01 which is the contentPath for a scrollpane called scrollpane01. I'd like the button to work, and depending on the code it will work in the normal .swf but won't when I embed my movie into xml.
If I put the code inside movieclip01
button01.onRelease=function(){
_root.gotoAndPlay("Frame Name");
}
It will work when I test it but not in the XML. So what I want to do is go to the main timeline where the scrollpane is and write the code there. That is where I'm stuck.
I've tried scrollpane01.movieclip01.button01 and tried movieclip01.button01 and also tried scrollpane01.button01. Just for giggles I also tried scrollpane01.movieclip01 but none of that works
Last night I had a similar problem with buttons inside a movieclip that was on the root stage. They worked in the swf but not when I embedded the file - so I found this which worked (typed in the root stage)
movieclip01.button01.onRelease=function(){
Can't Seem To Get The Paths Correct When It's Occuring Inside A Movie Clip Inside
main movie on _level0, navigation loads into _level1, icon is dragged and dropped loading another samples.swf into _level2.
drag and drop works fine running outside of main movie but not inside main movie. i'm assuming i've messed up paths.
i tried to include the code (twice now) but it keeps cutting off my message.
it's an action on a button inside a movie clip inside a movie loaded into _level1. it needs to reference a movie clip on the main timeline of the _level1 movie. what would the path be?
Rotating Movieclip Inside A Button, Inside A Scrolling Menu Bar
Hi all,
I'm pretty new to actionscript, and I'm kinda moving along; up until now.
I've used the the infinite scrolling menu tute at kirupa.com, created my own button graphics, and have a nice scrolling menu. On the buttons, I'm adding an image (which seems to need to be a movie clip to work), so when you rollover the button, the image will spin.
The code for the spinning works. I've tested it on the root frame of a new movie, and in the button of the infinite scrolling menu movie. I've added the code to spin the image on the "over" frame of the button timeline. With the button scene open, I run "test scene", stop it, and move between the frames. When I advance to the rolloever frame, the image spins like a top, but when I test it from the root of the movie, the image does not spin. I've also added a color change "that works" from the root when you rollover the button, but the not the spinning image.
I've added the image by editing the button from the library. I select the image, and add the code inside an onClipEvent(enterFrame) action.
I've also tried adding the code to the keyframe of the root scene in layer 1, and tried calling the image by the full path (_root.one_button.buttons.button1.spin1._rotation= blah) thinking it needs to know exacty where the image(movie clip) is at in the heirarchy to no avail. I've even went back and gave everything an instance name up unto the button I'm trying all this on.
Any help would be appreciated, since I'm about ready to shed tears over this.
Thanks!
-Sam
OnRollOver() Inside MoveClip Inside MovieClip Doesnt Work
could someone help with this. i dont know why the onRollOver function doesnt work for my submenu button. trace("over main btn") for mainmenu button works fine but trace("over submenu btn"); doesnt work :/
ActionScript Code:
CreateMainMenu = function (x, y, depth, node_xml) {
var cNode;
var cItem;
var cMenu = this.createEmptyMovieClip("mainMenu", 0);
for (var i = 0; i<node_xml.childNodes.length; i++) {
cNode = node_xml.childNodes[i];
cItem = cMenu.attachMovie("mainMenuBtn", "mc"+i, i);
cItem._x = menu_x+i*(cItem._width+5);
cItem._y = menu_y;
cItem.menuname = cNode.attributes.name;
cItem.node_xml = cNode;
if (cNode.nodeName != "menu") {
cItem.arrow._visible = false;
}
cItem.onRollOver = function() {
this.gotoAndStop(2);
h = 0;
clearInterval(newInt);
trace("over main btn");
subMen = this.createEmptyMovieClip("subMenu",200);
newInt = setInterval(openSubMenu, 50, this._x,this._y,subMen,this.node_xml);
}
cItem.onRollOut = function() {
this.gotoAndStop(1);
this.subMenu.removeMovieClip();
};
}
};
openSubMenu = function (x,y,clip,node) {
if(h<node.childNodes.length) {
subM = clip.attachMovie("subMenuBtn","subBtn"+h,300+h);
subM.menuname = node.childNodes[h];
subM._visible = true;
subM._y = subM._height*(h+1);
subM.onRollOver = function() {
trace("over submenu btn"); //<------------- it doesnt work :(
}
h++;
} else { clearInterval(newInt); }
};
var menu_x = alertArea._x;
var menu_y = alertArea._y;
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(succeed) {
if (succeed) {
alertArea._visible = false;
CreateMainMenu(menu_x, menu_y, 0, this.firstChild);
} else {
alertArea.alert = "error: XML not successfully loaded";
}
};
menu_xml.load("menu.xml");
sample xml file for this menu:
ActionScript Code:
<?xml version="1.0"?>
<menu name="XML Menu">
<menu name="firm">
<item name="about" link="http://#"/>
<item name="portfolio" link="http://#"/>
<item name="contact" link="http://#"/>
</menu>
</menu>
does anybody know what is the problem ?
Rotating Movieclip Inside A Button, Inside A Scrolling Menu Bar
Hi all,
This question is going ignored in some other boards, so I thought I'd try here....
I'm pretty new to actionscript, and I'm kinda moving along; up until now.
I've used the the infinite scrolling menu tute at kirupa.com, created my own button graphics, and have a nice scrolling menu. On the buttons, I'm adding an image (which seems to need to be a movie clip to work), so when you rollover the button, the image will spin.
The code for the spinning works. I've tested it on the root frame of a new movie, and in the button of the infinite scrolling menu movie. I've added the code to spin the image on the "over" frame of the button timeline. With the button scene open, I run "test scene", stop it, and move between the frames. When I advance to the rolloever frame, the image spins like a top, but when I test it from the root of the movie, the image does not spin. I've also added a color change "that works" from the root when you rollover the button, but the not the spinning image.
I've added the image by editing the button from the library. I select the image, and add the code inside an onClipEvent(enterFrame) action.
I've also tried adding the code to the keyframe of the root scene in layer 1, and tried calling the image by the full path (_root.one_button.buttons.button1.spin1._rotation= blah) thinking it needs to know exacty where the image(movie clip) is at in the heirarchy to no avail. I've even went back and gave everything an instance name up unto the button I'm trying all this on.
Any help would be appreciated, since I'm about ready to shed tears over this.
Attached is the zipped fla file
Thanks!
-Sam
Behavior On Buttons Inside A Movie Clip Inside A Button.
I would like t create an animated button with menu inside, how do i do it.
something like on here http://www.demarchelier.net
hidden menu on left side (contents) but on flash. I have flash 8. any tutorial that explain how to do that ?
Tween Inside A Button Inside A Movie Clip
Say I have 3 squares, from left to right, blue, red, yellow. The 3 squares together are a MC that move from off the stage on right, across the stage to line up on the left. Now say I want to make the left blue square a button so that when you roll over it, it has a orange frame and then when you press down on it it dims, and a larger version of it shows up above it. how would I do this? What i've done so far is made a button inside the MC, then on the down state of the button made a graphic button for the blue square, but it doesn't stay dimmed, and I don't even know how to make the larger blue square appear.
Is this too confusing?
please help.
thanks
Load A Movie Inside Blank Clip From Inside Itself?
Hi,
I am working on a site and I have a blank movie clip called contents. I have a button that when clicked, loads a swf (2.swf)inside of it. then I have a button in 2.swf, when clicked, I want it to load a swf in contents (the same movie clip that it was loaded into). I have tried using _root. and _parent. infront of the loadmovie code, but those aren't working. What code would I use to do this?
Thanks, Matt
SetInterval Inside A Loop Inside A Function - Am I Crazy?
I've got a menu loading from XML data - however I'd like the mc's to appear sequentially, maybe 1/10th second apart. I know setInterval should do this, but I'm still new to flash and despite trawling Google for 24 hrs solid, nothing seems to show me the right way.
Here's the script:
Code:
function CreatePortMenu(port_xml)
{
var portClients = port_xml.firstChild.childNodes;
var xPos = 0;
var yPos = 0;
var xSpacing:Number = 90;
var ySpacing:Number = 35;
var i = 0;
for ( i = 0; i < portClients.length; i++ )
{
switch (i) //splits the menu items into columns of 4 (max 12 items)
{
case 0:
case 1:
case 2:
case 3:
yPos = ySpacing * i;
break;
case 4:
case 5:
case 6:
case 7:
xPos = xSpacing * 2;
yPos = ySpacing * (i - 4);
break;
case 8:
case 9:
case 10:
case 11:
xPos = xSpacing * 3;
yPos = ySpacing * (i - 8);
}
var currentClient = portClients[i];
var portHold = portHolder_mc.attachMovie( "jobOption", "pb"+i, i, {_x:xPos, _y:yPos});
portHold.jobTitle.jobText.text = currentClient.attributes.title;
}
}
So I *think* I should be inserting two lines, one creating a setInterval, and one clearing it, but where? Some guides say inside the function, some say outside, some say only the clearInterval should be inside, some have the function inside the loop... I also *think* I've tried every possible combination, but no soap. Please help!?
Tabbing Inside A Form, Inside ScrollPane Component?
I have several forms but one of them needed to be scrolled because it's too long. I've been using the fieldname.tabIndex on all my forms but when I try to tab this form that contains the tabIndex it pops outside the ScrollPane component every time. I setup the form like the rest then gave it an instance name of "form," I set the linkage on the properties to "form." Next I placed a ScrollPane on the main timeline and assigned it to "form." When I try running the movie and tabbing between the fields in the form it pops out of the component to another instance.
What do I do?
I've given the url address to the movie:
See the movie here, select "MENU" then "Nominate" to view the problem
Thanks - Rob
Using External .txt Inside Movie Clip Inside .fla
I've seen a hundred and a half posts on similar subjects, but goshdarnit, I just can't make this work. Let me explain the problem, and I've included a link to a Zip file with my .fla file and the away.txt file I'm calling the variables from.
Basically, I want to create an interactive menu thing, that starts with a row of each of the 26 letters of the alphabet. When one clicks on a letter, the letter is tweened to a larger faded state, and so is the rest of the alphabet, and I want the names of the schools starting with that letter to then fade in. I have a movie clip inside the last frame of the main tween, which should then tween (fade in over 12 frames) the graphic symbol containing my dynamic text box, which is supposed to be linked to the text variables in the external file. The text variable is created on the first frame of the main timeline using Actionscript on the static header layer, and so I should be able to load it inside my movie clip (I think). Everything looks fine to me, but then I've only been using Flash for 2 weeks.
My Zipped source files can be found at: http://www.tolcs.org/athletics/away.zip
If anyone would be willing to download my source files and give some wonderful advice, I'd revere and adore them forever.
Can't Tab Inside A Form, Inside ScrollPane Component.
I have several forms but one of them needed to be scrolled because it's too long. I've been using the fieldname.tabIndex on all my forms but when I try to tab this form that contains the tabIndex it pops outside the ScrollPane component every time. I setup the form like the rest then gave it an instance name of "form," I set the linkage on the properties to "form." Next I placed a ScrollPane on the main timeline and assigned it to "form." When I try running the movie and tabbing between the fields in the form it pops out of the component to another instance.
What do I do?
I've given the url address to the movie:
See the movie here to view the problem, goto "Menu" then to "Nominate
Thanks - Rob
Button Inside Swf Needs To Target Label Inside Different Swf
I have two different swf files (valet.swf and transit.swf) loaded into 2 different container MCs on a main timeline. One is in the container MC contentsValet the other is in contentTransit. I have a button inside the transit.swf that when pressed needs to go to the label "valet" inside the valet.swf file and am not having any luck with getting it to work.
Here is the code I tried to use on the button
on (release) {
_root.contentsValet.gotoAndPlay("valet");
}
Addressing A Timeline Label Inside A Mc Inside A Mc
? how would you write:
if(c=1){
gotoAndPlay.home.trans "contact";
}
... .home is a mc that contains .trans mc and "contact" is a label in the .trans mc timeline.
I get the
contactbtn.on(press) {
gotoAndPlay ("next"); // address label within the current mc
}
but am unclear how to do this correctly when the timeline label is within a movie clip inside another movie clip.
thanks for the clarification
Self taught... still learning actionscript flasher
Using SetInterval Inside A Function, Inside A Loop
I'm very confused by this now
I'm trying to use setInterval to delay what happens on a rollOut function, which is added to every button inside a loop.
Can anyone help me with the syntax, I'm totally lost!
Thanks,
James
PHP Code:
for (var i = 0; i<=(node.length); i++) {
currentButton.num = i-1;
//----attach the projectButton movieclip from the library----//
attachMovie("projectButton", "projectButton"+i, i);
//----move the button to the right place----//
currentButton = _parent.portfolio["projectButton"+i];
currentButton._y = 1+(26*k);
currentButton._x = 2+(230*j);
//----put the name of the project onto the button----//
currentButton.projectID.text += node[i].attributes.title;
//----rollover function----//
currentButton.onRollOver = function() {
currentButtonNow = _parent.portfolio["projectButton"+this.num];
currentButtonNow.projectID.text = "";
currentButtonNow.projectID.text += node[this.num].attributes.description;
};
//----rollout function----//
currentButton.onRollOut = function() {
APause = setInterval(GoBack2, 500);
//calls a function called GoBack every 'x' seconds//
function GoBack2() {
// SOME FUNCTION HERE!!!!!!!!
clearInterval(APause);
trace('clearing interval of '+currentButton.num);
}
currentButtonNow = _parent.portfolio["projectButton"+this.num];
currentButtonNow.projectID.text = "";
currentButtonNow.projectID.text += node[this.num].attributes.title;
};
//----release function----//
currentButton.onRelease = function() {
loadMe = node[this.num].attributes.id;
gotoAndPlay(10);
//gotoAndStop("portfolio");
};
//---- take out the leftover one idiot ----///
if (currentButton.projectID.text == "undefined") {
_parent.portfolio["projectButton"+i].removeMovieClip();
}
//---- watch the old variables mr greig ----//
k++;
//---- slit the list into 2 columns at which point? ----///
if (i == (8)) {
j = 1;
k = 0;
}
HitTest Problem- In A Button Inside A Mc Inside
hi,
anybody can give me a simple code using hitTest();
I did'nt know what is the right syntax for this command and where is the right place to put it.
here's the situation:
I have a 'gallery' movieclip and nested to it is a gallery button and when you over it, it txt color change.
but d problem is i didn'tknow where is the right location to put the hitTEst code and what is the right syntax?
i put this in frame1 of code frame
stop();
profileNav.onPress=function() {
gotoAndStop("profile"); }
galleryNav.onPress=function() {
gotoAndStop("gallery"); }
pressNav.onPress=function() {
gotoAndStop("press"); }
contactsNav.onPress=function() {
gotoAndStop("contacts"); }
and this code to galleryNav movieclip
on (release) {
//Goto Webpage Behavior
getURL("D:/Normz/Graphic Design/projects/mary-2nd/flash-new/gallery.swf", "main");
//End Behavior
}
pls help me. thanks
norman-RP
Button Inside Mc Inside Mc Not Working...
Hi there
In the main scene I have a movieclip "Map" which contains a movieclip "BakerStreet" which contains an invisible button. I am trying to call up different actions inside the "BakerStreet" movieclip using a rollover but am having problems, it just doesn't understand. Can someone help please.
This is the code I am using on the invisible button inside "BakerStreet".
on (rollOver) {
_root.BakerStreet;
gotoAndPlay ("BakerStreetRollover");
}
Thanks for your help.
Paul
Button State Inside Mc Inside Another Mc With As Over It
Hi everybody,
I'm having a little problem with a button state. Any help is appreciated.
Here is my issue;
On the main timeline I've got 2 movie clips. When you move the mouse over mc x shows the mc y.
Onside mc x I have a button that has a motion tween applied to it. Inside that button I would like to change the color of the font on Over state.
When I use ActionScript to show or hide mc y the button state doesn't change to Over. As soon as I remove the Action script, it works just fine.
Please help me understand why this happens and how I can resolve it.
Thanks in advance!
Here are attached files.
button.zip
Swf Inside A Swf Inside A Swf Resize Problem
I wonder if someone would be willing to help me privately with a simple but annoying problem. I've inherited a Flash-based site which was originally done in Flash 5. I have re-exported every SWF into Flash 7, but have made no changes to scripting, because the job would be enormous. It all works except for one new element I am trying to add.
The site uses a blank loader movie into which the main interface (another SWF) loads. Inside that the different content (more SWFs) load. And inside those other SWFs load. A total of around 60 different small SWF files. Which makes it fast to load and easy to update.
BUT...
I am trying to add another SWF (call it "e-card showcase") which loads inside a SWF inside a SWF. And in my new SWF, other separate movies will load. Those movies are sample e-cards.
The e-cards utilize Sham Bhangal's Flash Camera component, which uses Action Script to control the stage size, and do zooms and pans without physical tweening.
Here is the problem: When I test the e-card showcase SWF alone, the e-cards all load at the correct size, which is 550x400.
When I test it inside the main movie-inside a movie-inside a movie (stage size 800 x 600), the e-cards load at 800 x 600, which is too big. What's more, if I click to load a new e-card while another one is still playing, the new movie loads at whatever size the Flash Camera has set the stage at that moment.
The Flash Camera script uses the size of the _root stage as its reference, which I suspect is the heart of the problem. But I cannot alter the Flash Camera script because I do not have the source FLA files for most of the e-cards.
I therefore need a way to force each e-card to load at 550 x 400 when the button is clicked.
I've posted a similar question with the relevant Action Script about two weeks ago and got zero responses. I wonder whether someone would be willing to help me privately. I'm sure there is a simple answer to this issue, but it helps to have my FLA files to do the testing.
If you're willing to help, I'll be happy to do you a favour in return with a little Flash cartoon illustration for your own site.
Cheers.
Trigger A Button Inside A MC From Another Btn Inside Another MC
Hi,
I have a series of buttons inside a MovieClip, that contain ActionScript. Inside another MovieClip I have another button that I want to trigger the actions from a specific button inside the first MC.
Here is the code for one of the series of buttons (i.e. Menu):
Code:
on (release) {
_root.container.unloadMovie();
_root.container.attachMovie("geral_respCorp", "liveContainer", 1);
this._parent.A.NewY = this._parent.A.OrigY;
this._parent.A.gotoAndStop(1);
this._parent.B.NewY = this._parent.B.OrigY;
this._parent.B.gotoAndStop(1);
this._parent.C.NewY = this._parent.C.OrigY;
this._parent.C.gotoAndStop(1);
this._parent.D.NewY = this._parent.D.OrigY;
this._parent.D.gotoAndStop(1);
this._parent.E.NewY = this._parent.E.OrigY;
this._parent.E.gotoAndStop(1);
this._parent.F.NewY = this._parent.F.OrigY;
this._parent.F.gotoAndStop(1);
this._parent.G.NewY = this._parent.G.OrigY+this._parent.Control.FH-this._parent.Control.ButtonH;
this._parent.G.gotoAndStop(1);
play();
}
This code is for the button named "A" inside the MovieClip "MainMenu".
Now, in the movieclip loaded in the container MC, I have a button named "Next", and basically this button unload the MovieClip loaded inside the container and load another one, but I want to assign the code of the "A" button, to this button.
I had tryied to make somthing like this:
Code:
on (release) {
_root.container.attachMovie("business_key", "liveContainer", 1);
MainMenu._parent.A.NewY = MainMenu._parent.A.OrigY;
MainMenu._parent.A.gotoAndStop(1);
MainMenu._parent.B.NewY = MainMenu._parent.B.OrigY;
MainMenu._parent.B.gotoAndStop(1);
MainMenu._parent.C.NewY = MainMenu._parent.C.OrigY;
MainMenu._parent.C.gotoAndStop(1);
MainMenu._parent.D.NewY = MainMenu._parent.D.OrigY;
MainMenu._parent.D.gotoAndStop(1);
MainMenu._parent.E.NewY = MainMenu._parent.E.OrigY;
MainMenu._parent.E.gotoAndStop(1);
MainMenu._parent.F.NewY = MainMenu._parent.F.OrigY;
MainMenu._parent.F.gotoAndStop(1);
MainMenu._parent.G.NewY = MainMenu._parent.G.OrigY+MainMenu._parent.Control.FH-MainMenu._parent.Control.ButtonH;
MainMenu._parent.G.gotoAndStop(1);
play();
}
But nothing happens. can someone help me in this matter?
thank you
Eduardo Ribeiro
Frames Inside An Swf?
i mean frames as in a www site. is it possible? that would be *****in... if not, we should suggest it to macromedia for the next release. Happy Flashing
Swf Playing Inside A Swf
OK, here goes. Ive posted on another forum without any solution. I am somewhat of a noob in actionscript 3. I am creating a swf player from a parent swf that is navigated by the photoflow component at flashloaded. So the loader plays swfs based off of selections in the component. it also detects if a swf is done playing and starts the next. The following is my code to accomplish this:
Code:
import com.flashloaded.as3.PhotoFlowEvent;
myPhotoFlow.autoFlipDelay = 4;
myPhotoFlow.photoAngle = 10;
myPhotoFlow.selectedReflectionAlpha = 65;
myPhotoFlow.reflectionDepth = 40;
myPhotoFlow.selectedReflectionDepth = 45;
myPhotoFlow.selectedY = 15;
myPhotoFlow.motionSpeed = 4;
myPhotoFlow.distance = 5;
myPhotoFlow.spacing = 100;
var swiffIds = new Array();
var swiffThumbs = new Array();
var swiffPaths = new Array();
var index:Number = new Number(0);
var temp:Number = new Number();
var closeVid:Number = new Number(1);
var loader:Loader = new Loader();
LoadSwiffys(closeVid);
function swiffysLoaded()
{
var url:URLRequest = new URLRequest(swiffPaths[index]);
//var loader:Loader = new Loader();
loader.load(url);
addChildAt(addChild(loader), 1);
//start loading.swf
var loadingurl:URLRequest = new URLRequest("loading.swf");
var loading:Loader = new Loader();
loading.load(loadingurl);
addChildAt(addChild(loading), 1);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
//trace("Loading: "+percentLoaded+"%");
}
function loadComplete(event:Event):void {
loading.unload();
//trace("Complete");
var i:Number = new Number((MovieClip(loader.content)).totalFrames);
//trace(i);
(MovieClip(loader.content)).addEventListener(Event.ENTER_FRAME, nextVideo);
}
//event listener for click on a thumbnail
myPhotoFlow.addEventListener(PhotoFlowEvent.CLICK_SELECTED, photoClick);
//myPhotoFlow.addEventListener(PhotoFlowEvent.SELECT, photoClick);
function nextVideo(event:Event):void {
if ((MovieClip(loader.content)).totalFrames == (MovieClip(loader.content)).currentFrame) {
(MovieClip(loader.content)).removeEventListener(Event.ENTER_FRAME, nextVideo);
loader.unload();
temp = index + 1;
if (temp == swiffPaths.length) {
index = 0;
myPhotoFlow.setSelection(0);
} else {
index++;
myPhotoFlow.next();
closeVid = 0;
}
swiffysLoaded();
}
}
function photoClick(eo:PhotoFlowEvent):void {
var len:Number = swiffThumbs.length;
for(var t=0; t<len; t++){
myPhotoFlow.removePhoto(0);
}
index = 0;
var vidNum:Number = (eo.data.desc);
//trace(vidNum);
(MovieClip(loader.content)).removeEventListener(Event.ENTER_FRAME, nextVideo);
loader.unload();
LoadSwiffys(vidNum);
}
}
function addPhotos() {
var len:Number = swiffThumbs.length;
for(var r=0; r<len; r++){
myPhotoFlow.removePhoto(0);
}
//var len:Number = swiffThumbs.length;
for(var t=0; t<len; t++){
var obj1:Object = {name:swiffIds[t], desc:swiffIds[t], url:swiffThumbs[t]};
myPhotoFlow.addPhoto({name:swiffIds[t], desc:swiffIds[t], url:swiffThumbs[t]}, t);
//trace(swiffIds[t]);
}
//myPhotoFlow.addEventListener(PhotoFlowEvent.CLICK_SELECTED, photoClick);
}
//////////////////////////Functions to load swiffys///////////////////////////////////
function LoadSwiffys(closeVid)//eventually,pass the IP and refer in here
{
var request:URLRequest = new URLRequest("http://192.168.1.172/newsite/loadswfs.php?click=" + closeVid);//and send ip and refer here too
var variables:URLLoader = new URLLoader();
variables.dataFormat = URLLoaderDataFormat.VARIABLES;
variables.addEventListener(Event.COMPLETE, completeHandler);
try
{
variables.load(request);
}
catch (error:Error)
{
trace("Unable to load URL: " + error);
}
}
function completeHandler(event:Event):void
{
var loader:URLLoader = URLLoader(event.target);
var variables:URLVariables = new URLVariables(loader.data);
swiffIds = variables.swiffId.split(",");
swiffPaths = variables.swiffPath.split(",");
swiffThumbs = variables.swiffThumb.split(",");
swiffysLoaded();
addPhotos();
}
When i run it in the output window I get an error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MethodInfo-394()
I have been told that it might have something to do with this line:
(MovieClip(loader.content)).totalFrames == (MovieClip(loader.content)).currentFrame
but im not sure. Its not a huge deal because it still functions correctly, except most browsers throw an error and stops the play. Does anyone know what might be wrong? or if you dont know, is there a way to supress the output so this error does not come up on browsers? Thanks for the help.
Hit Counter For Frames Inside .swf
Does anyone know whether or not flash can record 'hits' in a .swf. For example: in a 20 frame movie, can a counter be built that will identify which frames a visitor viewed? If it can be done, would like to learn how, or pay someone to build one. Thanks
Jumping Between Frames Inside A MC
Hi, I have trouble with jumping between frames inside a MC and/or multiple commands on one button ( I think...)
I have a MC which contains my menu system. Inside the MC I have made the motion tweening for all my menus.
The motion tweening have one "up frame set" and one "down frame set". In the middle I have assigned a stop command, so that the motion stops at "the top".
I have four of theese motion tweenings together with my menubuttons.
My problem is that I would like to assign actions to the buttons which tells; When menubutton 2 is pushed, then goto and play "up frame for that menu". When menubutton 3 is pushed, then goto and play "down frame set for menu 2", then goto and play "up frame set for menu3". Likewise for the other menubuttons.
I can't figure out how to do that. If someone can help me I'd be very thankful. I use MX
Rookie
Calling Frames Inside Another MC
Hi, i've got a problem... I have a few buttons inside this movie clip named "container"... however, I want the buttons inside that MC to load a specific frame in another MC. So for instance, I click on a button that's in the "container" MC, and once I release the mouse button, a car appears passing by the screen. then when i click another button in that container mc, the car unloads and a truck appears passing by the screen, and so on...
Thanks :P
Targeting Frames Inside Mc's From .as
using this code:
PHP Code:
package {
import flash.events.*;
import flash.display.*;
public class mainMenuMC extends MovieClip {
public function mainMenuMC() {
// Event Setup.
test2.artist_btn.addEventListener(MouseEvent.CLICK,navigationClicked);
test2.contact_btn.addEventListener(MouseEvent.CLICK,navigationClicked);
test2.gallery_btn.addEventListener(MouseEvent.CLICK,navigationClicked);
test2.web_btn.addEventListener(MouseEvent.CLICK,navigationClicked);
}
// Event Handlers.
private function navigationClicked(Event:MouseEvent):void {
var frmLabel:String='';
switch (Event.target) {
case test2.artist_btn :
frmLabel="artist_frm";
break;
case test2.contact_btn :
frmLabel="contact_frm";
break;
case test2.gallery_btn :
frmLabel="gallery_frm";
break;
case test2.web_btn :
frmLabel="web_frm";
break;
}
MovieClip(root).gotoFrame(frmLabel);
}
}
}
the frames are labelled inside test2, test2 is inside mainMenuMc.
i thought it would be like actionscript where i could use:
MovieClip(root).test2.gotoFrame(frmLabel);
but this brings up:
PHP Code:
ReferenceError: Error #1069: Property test2 not found on portfolio and there is no default value.
at mainMenuMC/navigationClicked()
any ideas?
If Frames Loaded Inside One .fla
can you have an if frames loaded action within an fla that loads say up to frame
200 when you're at say frame 100, or does it have to be an entirely different
scene? If so, do you just put the action on the frame (say again 100) and go to frame 101 when loaded, it wouldn't work in a MC right?
Playing Movies Inside Others
It’s possible to put a movie clip (780x425) playing inside other with 1024x768?
And when the first MC stops, load other MC’s automatically doing a loop!
Like a slide show… but with movie clips!
1st movie: intro.swf (780x425)
2nd movie: promo1.swf (1024x768) - I want this movie stops during 30 sec, and then play the next movie "How can i do that?"
3rd movie: promo2.swf (1024x768)
Swf Playing Inside An E-mail
Hi guys!
Does anybody knows hot to make an e-mail that uses swf animations within it? I mean, I dont want to attach an swf file, I want to have the swf playing within the message.
Thanks!
Playing Inside Another Movie.
I've seen this done before, but i have no idea how to do it, as everytime i do it, it doesn't work. To give you an idea of whats going on, i have lots of squares and inside the instances, they have the stop actionscript to stop at the start, then they fade up and out. Quite simpley, on each frame, i want certain ones to play, so they would all have instance names of 1, 2 ,3 etc and then in each fram it would state which ones to play.
Any ideas on how to get this to work?
Thanks in advance.
Playing A Frame Inside A Mc
I have a game, and on a mc called: Skater, it has this code:
onClipEvent (load) {
if (hitTest(_root.rail)==true) {
tellTarget ("_level2.skater") {
gotoAndPlay(3);
}
}
essentially i want when the skater collides with the rail for the movie clip to play the grinding animation on the 3rd frame inside it. if you get me.
Trouble Playing One Swf Inside Another
All,
I'm trying to load a SWF and play it inside another SWF.
Both SWFs are targeted to use Flash Player 8, and AS 2.0
So, in the parent, I've got code that looks like this:
var movie_mc:MovieClip = this.createEmptyMovieClip("movie_mc",
this.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("someothermovie.swf",movie_mc);
function onLoadInit(target_mc:MovieClip):Void {
target_mc.play();
}
When I run this in the Flash IDE, it runs beautifully.
However, when I try to play the movie in a browser, the inner movie
plays for a few frames, then just stops playing.
So potentially relevant facts -
- Both movies are set to run at 30 FPS
- The inner movie is about 2,700 frames long
- The inner movie has an audio track embedded on one of the layers
- The audio track has sync=Stream
I'm definitely sure the inner movie has stopped playing - I set an
interval in the parent movie that checks the inner movie's
_currentframe, and displays it in a text field - sure enough - it gets
to about frame 25, and just stops.
Notably - if I remove the audio track from the inner swf, the entire
thing runs perfectly, both in the Flash IDE and in a browser.
So, i'm assuming the audio track embedded in a layer, and/or
Sync=Stream has something to do with this?
Any advice or insight is MUCH appreciated!
Cheers,
Matt
Attach Code
var movie_mc:MovieClip = this.createEmptyMovieClip("movie_mc",
this.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("someothermovie.swf",movie_mc);
function onLoadInit(target_mc:MovieClip):Void {
target_mc.play();
}
Playing An External .MOV Inside A SWF?
Hi All
Just wondering if it's possible to play a .mov quicktime file inside a swf.
Flash can import .mov files and play them - but I want to load external .mov files at runtim without importing them.
Is there any way to load them using loadMovie() or something similar?
Any help would be appreciated!
-oka
Load Single Frames Inside A MC
I have two buttons and a MC that is three frames long. The first frame has 'stop ()' and the other frames have information that matches their respective buttons. I want button A, when clicked on, to show and stop on frame 2, button B to do the same for frame 3.
The thing that is throwing me off is that the buttons are not part of the MC itself. How can I get a single frame of the MC to load up and stay on the screen until the other button is pressed? Thanks in advance.
Extra Frames Inside Buttons
Hi all
Does anyone know why we are able to add more frames when inside a button?
obviously you have the up, over, down, and hit states, but whats the point in being able to add a 5th frame or 6th frame...etc.
Can anyone tell me if they have found a use for these extra frames.
Thanx.
Best regards.
Targetting Frames Inside Loaded Swf
Sorry for asking this again:
I have 5 buttons on the stage and have this code for each button + 5 external swf. (stacking swf on top of eachother when loaded to the stage).It works ok now
tot_mc.hotels_btn.onPress = function() {
var someDepth = empty_mc.getNextHighestDepth();
var mc_New = empty_mc.createEmptyMovieClip("hotelsup", someDepth);
mc_New._x = 500;
mc_New._y = 26.5;
mc_New.loadMovie("myMovie.swf);
trace(someDepth);
var mc_Target = empty_mc.getInstanceAtDepth(someDepth-2);
trace("mc_Target = "+mc_Target);
if (mc_Target != undefined) {
removeMovieClip(mc_Target);
}
};
It works ok now but I need to target a frame inside myMovie.swf. Dont need the whole swf to be loaded and want to have 2 clips inside "myMovie.swf" and target each of them seperatly from the stage buttons.
Thanks for your help
Koosha
Help With Links Inside Of Flash Frames
Just kinda got Flash today.
I created a new flash document, made 3 layers, and gave them frame names.
Content, Menu, Banner.
For some reason, when I target the content frame, it doesn't actually replace it.
It opens up a new site.
(I have the actual hyperlink linking to another SWF file. I changed the target to content)
Is there some action script I should be using?
I'd really appreciate some help.
-Kurt
Accessing Frames Inside Movieclip
I have a movieclip of a character and inside that have the animations for other actions (such as walking, attacking..etc..) on seperate frames.
Lets say i wanted him to attack.. i want the enemy to disapear when the guys arm touches them. (just the arm, not his whole body).
So i have on frame 2 of the character movieclip the moveclip of his arm extending but how do i target the arm.
Example:
_root.mcHero.frame2.mcHeroAttack.Punch
What do i put for frame 2? Or is there another way to get to it.
Playing .mov Inside Of Movie Clip
I've inserted a .mov into a movie clip, which is being called from a menu button (which is inside another movie clip). The movie clip is now on the main timeline, with 4 other movie clips - and 4 other menu's. When I look at the movie clip in editing mode, movie is there, movie plays. But when I export movie as a quicktime, scene shows up when button is clicked, but no quicktime movie. Wondering if there's some problem playing .mov's inside of movie clips, or do you have to have .mov on main timeline to work?
Appreciate any help on this one!
chris
Playing Inside Movie Clips?
I am using Flash MX-
Basically I have a field of flat tiles in flash that flip over when you roll over them. There is one generic movie clip for now that will be duplicated as unique clips once I get it working so that each tile can have an unique image on the backside. This way you reveal an interesting image as you flip the tiles(the images swap out also based on number of tile flips). The movie clip has the flip over and flip back animations inside it, labeled with frame labels. In order to get it to roll back I have a time counter which is 2 frames: frame 1 has counter=counter+1 and frame 2 is gotoAndPlay frame1's label. Then in order for the tiles to flip back over after a certain amount of time, there is a simple math function which subtracts the current counter value from the time value that the counter was at when the tile was rolled over(which is the variable tilecounter, which was declared inside the button). If the difference of those two variables is > 50 (50 is an arbitrary value for now just for testing) then this line: _root.tileflipover.gotoAndPlay("tileflipback") should play. However all that happens is that it goes to the first frame of the tileflip animation and stops. I can get the tile to flip over nicely when i roll over it but it will not roll back. There are no stop actions on any of the frames at that point. I looked in two separate actionscripting books and both say that I have set it up right. I am so frustrated with this that I dont know what to do. Its for a class project thats due thursday and everything is ready except for this goddam flip back. Any help is appreciated. I have posted a link to the .fla file so anyone can take a look at it. Thanks.
Yanky
Flash Tile Project
[MX] Playing A Clip Inside A Frame (how?)
hi
im trying to create a movie with loads of transitions so what I want to do to make it simpler is to have movie clip inside every second frame, so that it plays them one by one.
However I started and placed a movie clip symbol on frame 4 of my animation which I wanted flash to play - but it skips right over it and moves on to play the rest of the content and never enters this movie clip symbol or play it.
What am I doing wrong here?
Can someone guide me how I can make this hapen so that when the flash reaches frame 4 it plays the movie clip there first and then moves on to the next frame without looping the same movie.
Thanks
Aku
Playing .swfs Inside My Interface .swf
I have an interface.swf, which has a frame and mask. I want to run other .swfs inside this interface. Ideally, I would like a title screen (as a kind of placeholder) to appear first inside the frame on the interface with a button to press which would load the movie into this screen.
I've tried loadMovie, but it brings up the new .swf separate from the interface.
I'm sure this is probably quite simple and I'm being a doofus, but can anyone help me out please?
Thanks
Playing Swf With Duplicate Action Inside Another Swf
I am trying to load an swf such as the 'snow' samples on kirupa into another swf.
When I do so, the duplicate action slows down to one at a time. The 'snow' swf works fine on its own, but not when loaded into another movie.
I know there is a simple solution. Does anyone have it??
Thanks
|