ActionScript 2.0 :: AttachSound On An Included Movie?
May 17, 2007
Let's say i got Movie A, which loads Movie B at some moment. And let's say that Movie B creates a sound, lets say:
var sndMusic = new Sound();
and then attaches it...
sndMusic.attachSound("music");
[Code]....
well, when i open Movie B alone, the music plays; when I watch it while being included in Movie A, it doesn't... BUT the sounds that are simply added by dragging and dropping on a keyframe DO work on both cases. I believe it's sth related to attachSound...
View 4 Replies
Similar Posts:
Jun 28, 2010
So I am creating a photo gallery and in the process I have created a button that links to a movieclip and plays it to appear as a popup window of the larger picture.
on(release) {
attachMovie("gallery_mc", "window", 1);
window._x = 250;
window._y = 150;
}
I then included a close button that simply posts
on(release) {
this.removeMovieClip(window);
}
I am curious as how to make the movie clip popup centered in the screen as it is now popping up in the upper left hand side of the flash movie.
View 2 Replies
Sep 28, 2007
This is my first post, and and im not sure this is the right place to do it, but i need some help.
With AS2 in CS3, im trying to attach a sound from library, to a button that is also attach from library, when reading a XML file, but not yet succeed.
I want to play this sound the first time the button is attached and also onRollOver.
View 1 Replies
Jun 15, 2006
I have the following code:
PHP Code:
var soundPlay = true;var mySound:Sound = new Sound();mySound.attachSound("mySoundFile");
Does the above load my sound into my SWF file? This is what I want.
View 1 Replies
Jul 6, 2005
Are there issues with using attachSound to sync sound clips with Movie Clips? I currently am having this problem. I have all my sounds in a separate swf (sounds.swf), then I call the sounds like this:
Code:
gear1_btn.onRelease = function() {
logo.gear1.play();
sounds.gearssmfx.start();
}
I build the movieclips with the sound on the timeline, so that I know they sync up. Then I remove the sound from the movieclip, and actually play the sound with the AS above. The above AS should play the same in the browser, but doesn't. The problem is that the movieclip animations often run slower in the browser than they did within Flash. Is is possible that the movie is running at a slower FPS in the browser? I have noticed that it runs slightly slower in Firefox than IE. I'm currently using 32fps.
Here is my development : [URL]
Specifically, I'm having problems with the gears next to the letter "S" and "0", click on them to play.
View 2 Replies
Oct 1, 2010
1.Music player with an array of 3 songs;
2.The music player LOOPS one sound taken from an array of 3, and the sound is attached with attachSound method.
3.There are 3/4 buttons: Previous sound, Stop, Pause, Next Sound. With "previous sound" and "next sound" i actually mean next sound in the array.
So...I'm a bit "stuck" on managing the loaded and attached sounds, aka how to go to next sound, how to go to previous one etc.This is the code i've been able to write down:
Code:
var soundFiles:Array = ["9052_ok.mp3", "Glimmer_ok.mp3", "Loop_9095_ok.mp3"];
function playSound() {
var my_sound:Sound = new Sound(
[code]...
View 7 Replies
Feb 3, 2010
i am having this very big problem(for my particular application). i am writing this music application in flash and i use as2 to load randomly specific sounds which are in the same folder as the movie. the problem is that i need the sound to be replayed with fidelity and it seems flash is lowering the pitch of the "music" by a halfstep(it does the same when "previewing" it from the library). musically speaking, if i have an mp3 containing A at 440 hz played with piano timbre, Flash will lower it and when it is played through the flash player is its played as a G sharp(35 hz lower). I thought that if i will replace the attachSound with loadSound and the sound will be loaded externally and not from the library the problem will be solved. it seems that this won't solve the probem. the sound just doesn't want to be played at the frequency it has in the file from which is loaded. i had read somewhere that this is a flash player's bug.
View 8 Replies
Apr 14, 2004
I have a splash page.
I had a preloader which worked great before I added the sound (a WAV file) and I used attachSound.
Now the preloader doesn't work anymore!
I have tried putting the attachSound action on the main timeline, in the movieclip, in its own movie clip, EVERYWHERE! All to no avail.
View 14 Replies
Apr 14, 2004
I have a splash page. I had a preloader which worked great before I added the sound (a WAV file) and I used attachSound. Now the preloader doesn't work anymore! I have tried putting the attachSound action on the main timeline, in the movieclip, in its own movie clip, EVERYWHERE! All to no avail.
View 14 Replies
Feb 23, 2005
Can I use attachSound method to load 2 or more sounds to play at the same time? If yes, how?
View 2 Replies
Jul 24, 2009
The following AS2 code is placed inside MC "speaker":
ActionScript Code:
var homeSound:Sound = new Sound(this);
homeSound.attachSound("page1Sound");[code]....
The MC "speaker" is two levels deep (inside an MC, which is inside an MC) in a fla and will not play. However, when I copy the MC "speaker" (and associated sound file) to a new fla it plays fine.
View 3 Replies
Dec 24, 2010
Is there any way to use my xml data without using externall xml file? Normally, when I export my fla to swf I have to have xml file in the same folder. My project needs to be in one file. Can I paste xml data into some class and somehow use it?
View 1 Replies
Feb 12, 2010
I have a main Flash movie that preloads three external SWF's just perfectly.Everything is great...except the 1st movie is not smooth and really slow, the 2nd movie is a little better, and the third movie is the best.It's a rather simple Flash portfolio...I'm thinking it could be a stacking issue-but I've approached it from so many different ways instead of wasting my time shooting at thin air, I thought I'd give this forum a shot.How can I make these three movies play smoothly?I've attached the main movies FLA just to assist.
View 2 Replies
May 10, 2010
In one of my project, I will load a swf after a button click. I use Loader and try to access the document class by Loader.content as Movieclip. But I find if the target swf contains TLF and if you set the publish property to RSL instead of "merge into code", the content of Loader will be set to some "__Preloader__".
View 2 Replies
Aug 20, 2010
I am publishing and AIR 1.5 application from Flash CS4 on Mac OS X. I add a list of files to include in the Installer Settings>Included Files box. Sometimes when I publish or click "OK", the included files listing is not saved except for app swf and xml listings. This means I have to select all the files again. This does work sometimes, the files list is saved, but other times, not. It doesn't require opening and closing the Flash app, just opening and closing the dialog for it to fail to retain the list.
View 2 Replies
Sep 16, 2011
My priority is to have a fullscreen (standard size) 1024x768 H264 video played on an ipad app compiled with flash CS5.5 AIR for iOS using the StageWebView class. This works perfectly fine. Although with no official way to communicate with the StageWebView, I can't 'remove' the video once it's done playing. Enter StageWebViewBridge which enables AS <=> JS communication.
I'm trying to get around the overall poor performance of the Video class on the iPad (1 or 2). Playing the video inside a StageWebView loading a html5 object works amazingly great (read: GPU hardware decoded h264).I do need to shut the video off after it's done playing in the StageWebView. I am packaging a .mov file encoded in H264 that plays great in webkit browsers. If I just load a webpage in the StageWebView with a tag pointing to any video file it plays perfectly fine.
Once I introduce StageWebViewBridge it changes. They want files put in a /html folder. I'm sending paths of all kinds for the players src to play and no video ever loads. The video is named 'a.mov'. I tried player.src = 'a.mov', or player.src = 'html/a.mov', or player.src = './html/a.mov' or even using the File class to get the File.applicationDirectory and resolve the file to the .nativePath. No matter what I send from AS to the JS in the StageWebView page, I cannot get it to load the video.
how to reference embedded files? I'd like to send the file to load from AS to JS and have JS reset the .src property of a html5 element. Even the File.applicationDirectory reference I make states the file 'exists', but I can never set the .src property of the element on the page. It doesn't seem to understand.
View 2 Replies
Mar 7, 2010
I understand the basics of OOP and classes, but I can't seem to find an answer to something between classes and static functions.
For instance, what if I have a Game.as class that's 1,500 lines long and I want to yank out groups of functions into external files (such as Scrolling.as or DepthManager.as)? Classes don't seem quite right, since I'm dealing mainly with the Game class variables, not separate entities. And putting one function per file would create so many dang files it's arguably worse.
So is there a way to do something like the old #include directive that will tell my Game.as class to just insert the contents of certain files into the middle of the Game.as class so I don't have to monkey with MovieClip(parents) and debugging the theoretical paths of null-object errors?
I'm guessing they took away #include for a reason, but I'm going to wear out my scroll wheel if I don't find a solution soon...
View 5 Replies
May 3, 2010
I am building an application where I want to be able to tab through some custom buttons (sprites with mouse event handlers). This is working in the main UI, but when I load an external swf with a button in it, the button does not get included in the tab loop. I can give the button focus via the arrow keys, but not with tab.
View 1 Replies
Jan 11, 2011
I import a class file with path: "src.Objects.Thing" . Later in the code I try to call getDefinitionByName("Thing"). Unfortunately, I get: "1065: Variable Thing is not defined".The way I fixed this was by writing: getDefinitionByName("src.Objects.Thing"). However, this seems like a cumbersome solution. I would really like to be able to exclude the path when calling getDefinitionByName.
View 2 Replies
Dec 10, 2009
At my job I frequently have to create Flash banners for major newspaper's websites. The specs that usually come in require a max file size of 30k or so. Usually my art department will hand me 3 or 4 screens that they want to simply move through in a loop. No biggie, until they start adding images to the files.
When I complain to them that the images are making the file sizes too big I am usually queried as to how other advertisers on these sites have full video in their ads. I understand that there are pre-loaders as well as allowed larger file sizes if you pay more for the ads.
getting image sizes down in Flash so that the images don't end up looking horrible?
View 1 Replies
Jan 12, 2011
I've got a problem headaching me all afternoon long: Inside an SWF I want to load an external SWF inside an empty movieclip. On that frame I've got: emptymovieclip.loadMovie("external.swf"); Inside the external SWF I've got a Preloader on the first frame consisting of a movieclip of 128frames. I'd like to appear from the first frame to the 128th related to loading percentage. When loaded it must go to fram 2 and this is the script on the movieclip:
[Code]...
View 4 Replies
May 23, 2011
I don't have access to the original Flash file [url]...
View 2 Replies
Sep 8, 2010
I am using Flex Builder for an Actionscript which apparently has a dependency on IMXML object. I'd never heard of this object, and there is nothing on the project site about any dependencies. I assume it's a Flex component library, though. Which library should I include in order for this program to resolve its dependency issues?
View 1 Replies
Sep 21, 2011
Due to decisions out of my control I've created a iPad app by way of a CS5.5 Flash build and using the 'Air for iOS' publish.
In the 'Air for iOS' settings I've included a file. The issue I'm having is in trying to call the file and not knowing what the path is.
I'm hoping this is a case where files added in this manner are placed in a consistent location.
Is that the case? And if so, what would the path be?
View 1 Replies
Feb 20, 2009
How can I change the picture already included in a movieClip using actionscript since pictures don't have instance names ?
View 0 Replies
Aug 12, 2011
My problem is the following:I've been working with Flash CS4, and have written a script which creates a dynamic menu based on an array variable. The array variable needs to be located in a separate .as file so that I can use a bash script to create the array on the fly, based on files found in a specific folder. It's taken me weeks of writing both the bash and actionscript to make everything work smoothly. Everything works except for one small thing: when I update the file containing the array, the menu in the .swf fails to update with it. In order to update the menu, I'm forced to re-publish from within Flash itself.
Previously I had used the "include" function to place the array within my script, but I then tried bringing it in with a package as a global variable. Neither method worked. It seems that the file is included during the publishing (that's probably common knowledge). So I'm wondering if there's a way to include the array, or build the array, in such a way that will allow the .swf to update with a simple refresh of the web page.
ActionScript Code:
Package containing array:
package {
[code]....
View 4 Replies
Sep 23, 2005
Code:
this.onLoad =function(){
this._xscale = 70;
this._yscale = 70;
};
[code]....
if i have a row of mc (8) on a line that i want this script to work for do i need to have this script written out for (8) mc's or, on the root timeline? also for more than one mc, am i just changing (this) to what ever the name of the mc is? also instead of mc's will this script also work for buttons? or do i need to just put a hidden button over the top of this mc?
View 14 Replies
May 18, 2009
I'm going to load some external files in to my main fla-file. I want the code in my main fla to be executed when all files are properly loaded.
#include "MyFile.as"
I had this:
Code:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadCompleted);
loader.load(new URLRequest("MyFile.xml"));
[code]....
but now I want to include an as-file aswell so both has to be loaded before loadCompleted triggers.
View 2 Replies
Feb 7, 2012
To rephrase my question: if you have a class with a bunch of static methods and you use one of them in your code, does the whole class get compiled with your movie? I suspect that it would be and, if that's the case, wouldn't it be better (from a file-size perspective) to use packaged functions instead?
View 3 Replies
Jul 22, 2009
Is it possible to export the image on the stage with the interface's grid included?
View 1 Replies