I am creating a program to play sounds from the library when a button is CTRL + CLICK. I have no problem if I play either of the two sounds on the first frame and then move to other sounds. However, if I navigate past the first sound buttons and try to play later sounds, I get: TypeError: Error #1009: Cannot access a property or method of a null object referenceat soundFile_fla::MainTimeline/playSound11()
I'm trying to learn AS3 and it hasn't vaguely been going well. I've been looking at dozens of tutorials for 2 days on attaching MovieClips from the library. Everything I've tried gives me errors and I don't know what to do anymore.
In my library I have a bunch of movieclips that are dynamically going to be placed on my stage. Is there a simple method of attaching ActionScript to these movieclips so that when they are used on the stage, they have the script applied to them already?
In my library I have a bunch of movieclips that are dynamically going to be placed on my stage. Is there a simple method of attaching ActionScript to these movieclips so that when they are used on the stage, they have the script applied to them already?
Then later I want to remove the movieclip from 'a' so I tried this:_root.removeMovieClip(_root.MC_menu.MC_windowI.attachedItemA);-and variations.But it does nothing!In the first code the first argument is itemFocusInv without quotes because it is variable, once it is attached it doesnt vary but when it is not then the movieclip varys. If attachedItemA doesnt let me remove the movieclip, what will? I tried using _visible and didnt work.
_root.MC_useItem.MC_yes.onRelease = function() { if(itemSpaceA == "MC_inventory_berry_blue"){ aI = false;
I would like to load movie clips from the library to the stage.How can I load them with some code on them? I mean load them already with onClipEvents on them, as if I added them myself to the stage..
I have some movieClips in my libaray called p1, p2 etc with export settings of the same name.I have the names stored in an array.I cant work out how to do this dynamically:
ActionScript Code: private var myImages:Array = [p1, p2, p3, p4, p5]; private function changeImage(newImg:Number):void {
I just need to gradually attach mc one by one into stage then get bounce...What I have so far is I just attach the all the total mc simultaneously..so how's to attach one by one then get bounce...
Here's the code... springSpeed = .9; springDamp = .6; xscale = 120; yscale = 120; function bounce() { [Code] .....
basically i have my blank document (no movieclips on the stage). I ahve my library item which is a movieclip and i want to attach this directly to the stage NOT into another movieclip.
the problem I've encountered on the home pg flash is that two big buttons and a bike animation should display prior to the photos loading. However, in firefox on both mac and pc(but not everyone's) when you refresh the pg such that it draws from the browser's cache, the buttons and bike animation do not display. Oddly, the photos still load consitently and in time as if those animations did take place. "oddly" because, the code to load the photos is part of an event listener, listening for the completion of the bike animation. So the code executes properly, despite the movieclips not appearing on stage(these movieclips are in library to begin and in my documnt class I instatiate them as follows:
realtors_btn = new RealtorsButton(); buyers_btn = new BuyersButton(); bike = new Bike(X-150);
[Code]....
also, originally I had this same issue in IE, but after switching from swfObject 2.0 to adobe's ac_runactivecontent.js method, I elliminated the issue in IE.
the problem I've encountered on the home pg flash is that two big buttons and a bike animation should display prior to the photos loading. However, in firefox on both mac and pc(but not everyone's) when you refresh the pg such that it draws from the browser's cache, the buttons and bike animation do not display. Oddly, the photos still load consitently and in time as if those animations did take place. "oddly" because, the code to load the photos is part of an event listener, listening for the completion of the bike animation. So the code executes properly, despite the movieclips not appearing on stage(these movieclips are in library to begin and in my documnt class I instatiate them as follows:
realtors_btn = new RealtorsButton(); buyers_btn = new BuyersButton(); bike = new Bike(X-150);
So im trying out AS3 and kinda havin some issues. I want to be able to attach a button or a movieclip that I have constructed in the Flash IDE - it contains a textfield, some other movieclips, etc.If i make it a button, I have tried subclassing the simplebutton class, attaching that class to the button, and then creating new instances of that class. That works fine - until I have to access, say, a textfield in the button. It seems that these elements are drawn, but are not accessible (or even connected in any way - i used flash.utils.descibreType(mybutton) and the instance names dont even show up in the XML).
So, I thought about a different route - using a movieclip or sprite, and making it react LIKE a SimpleButton. Not what I had in mind, but whatever. Unfortunately, it seems that when I subclass Sprite or MovieClip, the class has to be made dynamic in order to attach things to it from within the IDE before compilation (as opposed to from actionscript).
Basically, I have movie1, movie2, movie3, movie4 in the library, with linkages.
These are just 5 frame clips, with a single dummy_mc moving statically over the 4 frames.
I need these to be picked randomly and placed (each has its own set of co-ordinates where it should appear) on the stage at a random set interval (ie, every 2-3 seconds).
There are also 7 items (item1, item2, etc) in the library.
So once one of the 4 movies has been placed on the stage, I need one of these 7 items to randomly attach itself to the dummy_mc within that movie (and, I guess, generate instance names etc)
Is there some secret to attaching sound via a loop? I have had to hard code this and write it out 26 times.
Here's what I want:
ActionScript Code: for(k=1;k<=26;k++) {
[Code]....
I've tried it with _root, without, using a variable such as moji = eval("moji"+k) then moji.onPress, but nothing works. It just won't play the sound unless it's hard coded.
I'm having trouble attaching a sound to a movieclip so that it will be played on rollover.I've named the sound "click" and checked export for actionscript in the linkage properties. My movieclip is titled "contact" and has an instance titled "c1"
My problem: I am attaching variable number of MCs dynamically(not in the library), and i have to do so using flash6 or older. How can i use then loadMovie+onClipEvent handler to invoke something, if i am attaching MCs dynamically, and onClipEvent works only on MCs attached on the Stage(actions "on" those mcs, not "inside" them). Probably using classes. Any other option? and if not, can anybody guide me through assigning such class to such mc? EDIT: Ok, i also have done following:
[Code]....
and although the movieClip IS in library, and it DOES have MovieClip class assigned, onData event handler is NOT triggered and nothing is traced. Can the reason be "attachMovie" function?
EDIT2: aha. well, again it happened that attachMovie's methods are not yet initialized, so it was not yet "the proper time to assign" handler onData on those MCs. [only sen knows why ]. So that even trace(mc.stop()); at this point traces undefined, where it should trace [type Function], since stop is MovieClip's class method. Stupidstupidstupid.. relax...
i can in AS 1.0 attach a sound and play it on rollover fine...
Pretty much i have a button when you roll over it plays a sound thats it...very simple....i also know i can do it on the keyframes but i was hoping to do it dynamically as my site is completely created using AS barely no keyframes and i do not wish to start...
I have a problem with dragging movieclip which is dynamically generated via attaching movieclip from library.I want to move the movieclip by pressing the yellow square within a boundary say 100*4. I am attaching the flash file with this thread.
I´ve made a site for myself in flash (AS 2) and it works great. But one thing that I havent got the knowledge for is that I would like to have my own sound library.Anyway what I want is a xml updatable library, a simple list of sounds for visitors to download for free! A preview of the sound is also something that I need. The sounds are mostly very short sounds, so a rollover should work i think.[code]If there is someone here who would like to help me with this? Just to get me started. I fully understand if someone here thinks like, wow thats alot to ask for! how rude and so on, but if there is someone that maybe thinks that this could be fun or interesting and would like to give it a shot.
How can I edit sound from a timeline if I don't have the original sound file? When I right-click my sound in the library, I can't open it in any sound editor program. What do I do?
having real problems finding anything about fading in and out sound in flash, have searched for 3 days now and found mostly as2 related articles,i have the following
var myintSnd:introSound; var sndintChannel:SoundChannel; myintSnd = new introSound;
In Flash 10/AS3, I added some sound and it seems to be working alright, but I think I'm doing it wrong. I imported the sound into the library, but I believe that it's reloading it from the folder with the swf/sound. I'm loading them like so:
I have to play some sound on a webpage with javascript, and probably flash is the best choise, so i created an swf library with mi sounds wit swfmill [url]...[code]...
I figured out how to get sound to load from the library in AS3, which is good, however I'm trying to do the same technique in another fla with different mp3s and i get the following error. WTF?
'Sound has no valid device sound path although exporting device sounds was requested in the export settings. This sound will be ignored.' You can check out my code below, anyone else thats run into this let me know.