ActionScript 3.0 :: Main Fla In A First Scene With A Simple Movieclip?
May 11, 2010Have this code in main fla in a first scene with a simple movieclip.Seems not to work and cant figured it out
[Code]...
Have this code in main fla in a first scene with a simple movieclip.Seems not to work and cant figured it out
[Code]...
I have a movieclip in my main scene. Inside the movieclip, there's a button. I wanted to so if I click on the button, it takes me out of the movieclip's timeline and play on the main scene's timeline. I tried gotoAndPlay("Scene 1", 1), but it just take my back to the first frame of the movieclip, not first frame of the main scene (scene 1)
View 4 RepliesIn my FLA file (FLASH-8, AS-2)? in the library I have a movieclip named "mc" which is just one frame and in it specifies a property "price" like this: this.price="three";
In the main scene I have this code:
attachMovie("mc","t1",1)
t1.onPress=function(){trace(t1.price)}; //returns the correct value "three"
trace(t1.price); //returns "undefined"
Why the first trace(t1.price) returns the correct value and the second one returns "undefined"?And how do I make this property available without using onPress? The objective is to output the pictures of a set of movieclips and place the price of each picture under it using a dynamic textfield
I wanted to create a portfolio in flash, so I designed the layout in photoshop, with different webpages in different groups. So groups i created: home, about, porfolio, contact, affiliates, topbar, menu.I use Creative Suite 3 or CS3I then imported the groups into flash as movieclips, using the import to stage function. here is the image of the main scene in the flash. (SEE IMAGE 1st thumbnail)I created a new layer on top of all the layers and used labels at equal intervals to differentiate between pages.here's the image depicting the same.(SEE IMAGE 2nd thumbnail)Now in the home movie clip, i made all the text layers as movie clips to make button animations and assigned sounds and actions to them i.e. rollver, rollout andclick events. here's the swf.(PM ME FOR SWF)I want to know the code or method to load the frame labelled ''about'' in the main scene when i click on the movieclip button 'about' which is in the movieclip 'home'. Here's the code i tried for the first 'about' button, but it returns error "1120: Access of undefined property event."
code:
ActionScript Code:
var OverSound:roll_over = new roll_over();
[code].....
No..not that type of parenting ;DOK,I have a main scene, then sitting in the root scene I have 2 movie clips.1)centro2)fotoIn the first movie "centro" there is a menu btnI want this menu btn to call up mclarge + its frame (1) thats housed 3 levels inside the foto mc in root.
Main scene - (1) centro (banner which houses menu btn)
(2) foto_mc
- Main_boy_mc (<---works if menu btn houses in here)
[code].....
I can get by and make nice flash sites, but I'm still learning what goes where and am still borrowing code to get by.I've laid the problem out in some detail as I am sure that will save a lot of questions later on, but feel free to ask if you want more info.Problem is as follows: I've built a two scene flash site using open source code for the preloader scene:[code]The main scrolling menu scene works great when it's a one scene movie and the preloader code works fine with a load of other sites I've built, but when I put them together on this site (the code for the scrolling menu precludes the addition of a preloader directly into that scene so separate scenes are a necessity) everything goes to pot.When testing the site (both as a standalone SWF file and when embedded in an HTML file) the preloader works fine and the main scene appears correctly, but when you click on any button to move back or forth along the menu/timeline it jumps and jerks along very roughly and stops short of its designated point.
This causes the whole scene to fail as the designated timeframe for each button contains a movie instance that won't function until the specific timeframe is reached.It's odd behavior and I'm stumped as both chunks of code work fine separately.I've even tried a much simpler preloader that doesn't display percentage or anything, it just cycles between frame one and two until the movie loads and then plays it (just like this one, but with no bells or whistles).Unfortunately my lack of actionscript knowledge prevents me from even finding a simple term to sum up the problem so I've failed to find any similar issues on any forums or Google.
I added a website preloader in a separate scene to the main frame of my website and scripted it to go to and Play the main scene or frame of the website when finished loading. I then put a command in the first frame of the main scene for the movie to stop (); at that point. The problem is that now the buttons on the main page don't respond to any behaviour commands to go to and stop at other frames in the main scene. I'm not sure if this is a conflict between the stop(); command in the main scene and the button behaviour command to go to and stop at another frame or an error with the way I'm identifying the scene and frame.
View 5 RepliesI am try to go from a main scene to a second scene in Flash. The code work just fine to take me there, but when the scene appears it seems that I lose focus with the scene and the actions that should runs doesn't until I click once on the screen. Now I am using a button to navigate from one scene to another. If I use a movieclip instead of a button then everything works just fine. In my second scene I am using the keyboard to control different things in the scene.
View 1 RepliesI am just testing out how to place a button to go to a scene.I have 2 scenes named, one and two and 2 buttons...One on each scene to get them back to the other scene.The instance names on the buttons are scen1_btn and scene2_btn.My Functions are just called scene1 and scene 2.The code I have below is what I wrote, and I thought would work, but isn't.[code]
View 5 RepliesI have tried using the following to no effect:
ifFrameLoaded ("Main", 80) {
gotoAndPlay("Main", 1);
}
CS4 says this has been replaced by flash.display.MovieClip.framesLoaded but this doesnt seem to work the same, i keep getting errors.
Basically I have scene called "Loading" and I want AS3 i this scene to wait until my scene called "Main" has loaded before proceeding to it. I have an animation in the Loading scene to show its loading.
i got this script out of a flash MX book but it doesnt seem to be working. i'm trying to create a preloader with a simple status bar that loads a scene within the same file. the scene does end up loading. but the status bar just says "100% completed" the whole time its loading the scene. is there a flaw in the script or an i doing something else wrong?
[Code]...
New to AS and would like to know how to make a simple page where the viewer has to click several buttons before it moves on to the next scene. They can only go to the next scene when all of the buttons have been clicked.
View 3 Repliesi got this script out of a flash MX book but it doesnt seem to be working....im trying to create a preloader with a simple status bar that loads a scene within the same file. the scene does end up loading....but the status bar just says "100% completed" the whole time its loading the scene. is there a flaw in the script or an i doing something else wrong?
onClipEvent(enterFrame) {
loaded = _root.getBytesLoaded();
total = _root.getBytesLoaded();
From the main time line after clicking one button named "btn_mc" I go to a different scene named "About us" now if i want to come back to the main time by clicking another button named "Back to Main Menu" how can I write the code.
To enter into the "About us" scene I wrote this code to the button "btn_mc" which is in the main time line is something like this.
Code:
btn_mc.onRelease = function (){
gotoAndPlay ("About us",1);
}
I made a short movie at the beginning of my project and afterwards I made a symbol-movie clip with many motion tweens (at the end of the symbol animation I put stop(); ). Now I have a problem - how should I insert my symbol-movie clip after my first short movie? To one frame or to more ones? I have tried some ways but I have not found the solution - the symbol-movie clip is not ruuning in my main scene.
View 1 RepliesI have a mc INSIDE one of the layers in main scene, how to make it go to specified frame back on the main scene, when finished playing? Flash, cs4, as3.
View 1 RepliesI've just recently made the leap from AS2 to AS3 and after several days of reading the CS4 help and searching posts here, I'm still at a loss how to get my first AS3 project off the ground.I'm working on an illustrated choose-your-own-path story with each step split into seperate swfs to speed up loading time.I've got a main file loading a scene swf using.[code]The loading works fine (although I've just found a post that suggests I should wait until the swf loads before adding it as a child), but how would I then get the buttons in the loaded swf to tell the main swf which swf to load next?I'm stumped firstly by that, and additionally by how I should then UNload the swfs. Is it not common practice to refer to objects by their '.name' in AS3? Should I be loading the swfs into an array?
View 1 RepliesI am working with an iMAC running 10.6.8.I have created a flash file with only the main scene, which has a List button and a Home button. The List button has 20 links as a scroll list, each link installs a movie clip from the library.The problem I am having is the List button works fine until I add the Home button, then the Home button works fine, but the List button only works on the frame that the action is on. Each button is on it's own layer, and runs the whole length of the show, which is 220 frames. I have a stop label at each place a movie clip is to play.
If I remove the Home button from the main scene and put it into each movie clip, how do I tell the movie clip to go to the main scene frame 1?
I`m new here but as I`m working on my showcase for the university I experience a bit of a flash issues because of being noob What i can`t find out is what script to use so i can make a "back" button in a movie clip to load a designated frame (let`s say frame 5) from the main scene. I`ve tried this:
back_vs.onRelease = function(){
gotoAndPlay("sceneOne", 5);
}
[code].....
i would like to have a preloader run in a movie clip rather than in the main scene...http:[url]....i have followed this tutorial exact and it works when i create it on the main scene,but the loading bar and text doesnt work when i build it in a movie clip.
View 6 RepliesI have a movieclip in my main timeline as a menu. I want to go to a different scene in the main swf file depending on what scene I am in. Right now I'm using an if statement on the button within the menu (see below) but when I click on the button it only plays the first line of the if statement.
on (rollOver, dragOver) {
gotoAndPlay("s1");
} on (rollOut, dragOut) {
gotoAndPlay("s2");
} on (release) {
[Code] .....
I've imported my animations into a single projector using loadmovie.When the external animations finish playing how do i get the main projector to recognise that the animation has finished and move onto the next scene ?
View 1 RepliesI want the movieclip in Frame 1 Scene 1 to finish before skipping to Frame 2 Scene 1 im using gotoAndStop("Scene 1", 2); at the end of the MC
View 1 RepliesAny way to prevent a simple mc from slowing my main movie. As you will see, I uploaded 2 exact versions of the same movie but the first has an extra mc with a simple rotation of a shape in a 30 frame tween. and on the other that mc is not animated. The rotating mc is the light rays behind the purple spintop. And you will notice on the animated rays version, that the whole movie along with other mc's slow down. Some computers more than others. You'll notice the difference comparing the 2 movies if you wait for the flying gadget to appear.
Here is the link with the 2 examples: [URL]
(The rays_mc is a star shaped graphic symbol in flash vectors, not bitmap)
I've tried rotating the "rays_mc" via:
1. tween with 30 frames
2. Frame by frame with 10 frames
3. Using the _rotate parameter with onEnterFrame
4. I've thought that maybe the gradient fill was causing that slowdown, so I tried a solid fill but it was the same.
And all of them result in the same outcome. I don't understand why such a simple mc slows down the whole thing.
In the Main Timeline I have
Code:
import FlashVar;
// Instantiate FlashVar Class and Pass Root.
var myFlashVar:FlashVar = new FlashVar(this);
trace(myFlashVar.getVar('myFlashVar'));
[code]....
Now I have to pass 'this' when instantiating the class so that later I can use DocRoot to get the loaderInfo for FlashVars.Is there any way to not have to pass 'this' and have the external class point to the Main Timeline?
I am using Flash MX and am a complete novice to Actionscript. I created a movie clip with a dynamic text box that works fine when I test the movieClip scene. I brought that onto the main movie time line and when I go to test the movie, the dynamic text no longer works. I have tried different actionsript options on the main time line and on the movie timeline but cannot figure out where I am going wrong. Could someone give me a very basic walkthrough as to what I need to do to get this to work?
View 9 RepliesI am trying to jump from one scene called main to other named tutorial 1-6 here is my code to jump to tutorial 2 as an example
on (release) {
_root.gotoAndPlay("Tutorial2");
}
I've tried every variation that I can think of, no _root gotoAndStop and also putting in _root.gotoAndStop("Tutorial 2", 1);
i dont know if it makes a difference but the navigation buttons are on a movie clip which pops up over the main stage...if that makes sense, that flash file is huge i didnt want to attach the whole thing...
How can I load/unload a movie located on the main scene, from a movie clip, or vice versa. Right now I can only load/unload a movie if located in the same timeline.
View 2 RepliesI'm having trouble jumping to another frame (15) in the main stage named "main" when closing a movie clip on frame 10..
ArgumentError: Error #2108: Scene main was not found.
at flash.display::MovieClip/gotoAndPlay()
at welldone_mc/nextlevel_function()
the actions are as follows:
stop();
nextlevel_btn.addEventListener(MouseEvent.CLICK,ne xtlevel_function);
function nextlevel_function(evt:MouseEvent):void {
gotoAndPlay(15, "main");
}
i've tried labelling the frame, but the problem seems to be locating the scene "main"?
I Have a flashmovie thats almost done and will soon hit the internet, but I want to add some animations into the website it�s two gears that I�m about to put at the bottom of the page and when a button releases in the main flashmovie the two bottom gears will turn a few frames and just stand still.These three movies are all separate (main movie, first gear and second gear).
It's a homepage designed in HTML and flash that has this "main flashmovie" in the middle of the screen, the size is about 1500(width)X800(height). And the gears is about 800wX200h placed at the left and right side bottom of the page. Dont worry the site is easy to apply to any screen resolution.I have been looking everywhere for any soul out there who suffering from the same problem but no success. Is it possible to script a button in the main movie to launch two separate movies in their own contents?