ActionScript 3.0 :: Variable Name Which Starts With $?
Oct 12, 2009I was going through some codes and found vars being used like on PHP:
function($var:Number, $var2:Object){...
I was going through some codes and found vars being used like on PHP:
function($var:Number, $var2:Object){...
I had to convert an AS2 clicktag script to AS3. It complies and works locally, but I was told I need to use the FlashVars to embed/place a variable (a URL) in the swf before it even starts.This is something I haven't experimented with (yet)I've seen examples and I kind of understand it, but I was hoping on some clarification
var flashVars=root.loaderInfo.parameters;
I understand the dot synatx (enjoy using it), and the root is probably the begining (where it will place the sting) Im a bit confussied on the loaderinfo and the parameters what are here functions in the command.
var clickTAG = flashVars["clickTAG"];
then using the flashVars Im unsure on the use of square brackets (instead of using curly braces)Best guess:This will take the string passed to it "a url" clickTAG and use the flashvars to embed/place it in the root/begining tagged as "clickTAG"?
I've got a site that is using loadSound to play some mp3s and it works fine. however, the sound starts to stream, and then replays itself like a second later. my guess is that its playing faster than the load is going and when it gets to the point where it hasn't loaded enough, it starts to replay it, but i'm not sure that that is the exact problem. my code:
[Code]...
now, i tried making a playTrack function that i can call with setTimeout and i put that in the onLoad in place of track.start(), but that didn't work either (i was hoping to not start playing the track for 3 seconds to give it some time to buffer).
I have problems with creating a preloader in AS3. I have tried several tutorials but the problem remains... the preloader starts counting at 50% and is only shown after a few sec. I have removed all export in 1 frame from my instances.I have no sound. I would prefer not to load my main.swf into another swf, if there is another solution.
View 3 RepliesI don't known what happened but fdb.exe now always start debug swf in IE And IE not my default browser.How to return its default behaiviuor? (embeded browser only with swf)
View 1 Repliesam a very beginner in this field i don't have the code right now i just took it from simple preloader tutorialswat i did is i created a text field in my first frame and gave the code to that textfield
View 1 Repliesthis web site always seems to start with a blank screen and the preloader starts at 40%.
I nothing exported to the first frame!
[URL]
I have multiple players on the same page (flash as3), but I would like, that when a player is playing, stops, when another player begins to play...
View 2 RepliesI have preloader in a file whose size is about 87kb....but preloader appears only after 60% of movie is loaded....why is it so and how can i start preloader to show from 1%
View 2 Repliesi have my preloader text and bar and and my text starts from 50/48 occassionally and goes to 100%...why is this starting from 48/50?? here is my AS frame 1:
Code:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;[code]....
After a few years of using Flash I am creating my first project in AS3 and am running into some problems which are quite common involving targeting movieclips and controlling them. Basically I have a fla which has an MC on the timeline with an instance name of INFO_MC. Now i want this MC to be invisible when the swf starts and I have managed this by using the following code: Actionscript Code: INFO_MC.visible = false;
This is fine. However I get stuck when I try to make INFO_MC visible when I click a button in a loaded swf. How would I target INFO_MC from a button inside a loaded swf. Do I need to add an event to the button and then have a listener on the root timeline which would turn INFO_MC visible when it hears that the button has been clicked?
i convined by boss to splash out on flash cs4 for work to make the website. it worked fine for about a week. now, when i try to start it, it just starts to load then crashes. it looks as if it is going to load then doesn't. i have tried uninstalling, rebbotiong in safemode and using various registry programs and reinstalling
View 3 RepliesI want to prevent users from using webcam emulators, I have done that in AS2 by using senocular's function, but I can't make it work in AS3,so, here is the old version by senocular , and I would like to do the same in AS3, tried using indexOf but doesn't work, I need to find at least the first 4 characters of the string and compare them to the item inside the array in AS3![code]...
View 2 RepliesI'm working on a game in Flash CS5 / AS3 and I'm trying to get my preloader to work. At the moment, when I load the SWF file with 'simulate download', the file will load but my preloader won't show. The preloader does show for a moment when the loading is at around 90%.I have unchecked 'export to first frame' since that's what the Internet told me to do, but there are so many different tutorials for nearly every version of Flash/AS around that I'm rather confused; not sure how to fix this.My preloader code is as follows:
stop();
this.addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event):void{
[code].....
I'm comfortable with PHP and Javascript but this is the first time I'm using flash. I have Flash CS5.
I've managed to import a movie file, however, as soon as it's downloaded it starts playing. I've tried using the Action stop(); coding, which works file in the export preview in CS5, but on a website it runs straight away.
I know I can't use the command because that stops the timeline but by then the video is already playing. My solution would be to use and have the video in frame 2, then get javascript to jump to frame 2 when I was ready. However, I can't find a way to import a video file to a frame in CS5. Is there a better way?
Play a sound effect when the user mouses down on the HSlider. Stop or pause the sound when the user mousses up. The following code starts the sound but a mouseup does not stop it.[code]...
View 1 RepliesI am totally new to AS3.0 and OOP in general, so this is a very basic question I can't seem to figure out.I have a package.Inside that package is a class.
Inside that class is a function that initializes a timer called setTimer()
I am trying to run setTimer() when the program starts, but it seems that wherever I put the line setTimer(); in the program, I get an error.How and where can I run this function just once when the program starts, so I can initialize my timer?
I'm using the following script to load external swf's in to a main swf, but when I simulate download, the sound of the external swf starts playing before it is completely loaded, i.e, when the percentage in the bandwidth profiler reaches about 60% the sound of the swf being loaded can be heard, and when the percent reaches 100, it continues playing and the content of the external swf are now visible.
var myLoader1:Loader = new Loader();
addChild(myLoader1);
var myRequest1:URLRequest = new URLRequest("myMovie.swf");
myLoader1.load(myRequest1);
[Code]....
im currently creating a page that contains a number of movie clips where when the mouse goes over the movie clips, the mc (which is a photo) enlarges on the screen.
Currently when I click a second mc the first mc is still visible and if the second photo is on a layer above the first photo then it's enlarged image is in front of the first enlarged image. (does that make sense?)Current script is (without any actions to hide the images as they didn't work):
//mcBarbara
mcBarbara.addEventListener(MouseEvent.MOUSE_OVER, playMovie1);
function playMovie1(evt:MouseEvent):void
{
[code]....
I'm trying to figure out the code for an AS3 Calendar, does anyone here know how to get the day of the week the month starts on? I've seen examples on php but not in as3!
View 10 RepliesI put a slider on my web site exactly as it said on this tournament and the problem is that my slider starts from the half, Why?
View 3 RepliesI am totally new to AS3.0 and OOP in general, so this is a very basic question I can't seem to figure out. I have a package. Inside that package is a class. Inside that class is a function that initializes a timer called setTimer() I am trying to run setTimer() when the program starts, but it seems that wherever I put the line setTimer(); in the program, I get an error. How and where can I run this function just once when the program starts, so I can initialize my timer?
View 5 RepliesWeird problem going on right now. And I seriously don't know what this is about.
On my main timeline (new document)
I create a text. I convert that text to an image. I drag that image on my main timeline at frame 1.
Then I set opacity to 0%. Create a keyframe at frame 50. Then I Tween it. And at frame 50, I set opactity back to 100%.
When I test the movie (ctrl enter) it just doesnt show the tween AT ALL. It goes straight to the last frame.
When I just go to frame 1, and press enter. It does work like it's supposed to.
Simple loader thats counts to 7 and not 100%. The loading count shoud be like this: 1.1, 1.2, 1.3, 1.4, 1.5 up to 7 (7 equals 100%). How can we create a preloader like this?
View 1 Repliescreating a page that contains a number of movie clips where when the mouse goes over the movie clips, the mc (which is a photo) enlarges on the screen.
Currently when I click a second mc the first mc is still visible and if the second photo is on a layer above the first photo then it's enlarged image is in front of the first enlarged image. (does that make sense?)
I have tried a number of different functions to hide the current mc when a new one is clicked but I can't find any that work.
Current script is (without any actions to hide the images as they didn't work):
//mcBarbara
mcBarbara.addEventListener(MouseEvent.MOUSE_OVER, playMovie1);
function playMovie1(evt:MouseEvent):void
{
[Code].....
I want to start a timer when the game begins that counts up, but doesnt actually display the time during gameplay, but stops when a player has won and the screen goes to the player wins screen. From there i want that time to display in a text variable along with all the other statistics I have generated. The timer will also need a reset function when starting up the game again.
View 2 RepliesI have a very large projector movie with many loaded in swf files. I want to make it so as you are reading and viewing the whole movie the screensaver is not active. I then want it so after 10 minutes of no activity a screensaver (or movieclip in the movie) starts playing and then goes away when there is activity again. How do I do this? What would be the best way... just have the screensaver (movieclip) the only thing in the first scene and it just goes to this after 10 minutes?
View 18 Repliesmy site is finished but as it's quite a large SWF the preloader and logo doesn't appear on screen untill it's load about 40% loaded.
Is there any way to get the logo on screen before anything else comes up rather than just having a black screen? (without breaking the main movie into smaller ones).
here's the link:
[URL]
I have a wheel with info on it in pie shaped areas, the user can turn the wheel to any position. What I need to do is have movie clips play when the wheel is at a certain rotation, depending on where the wheel is turned different clips would play off to the side
View 2 RepliesI tried to implement a simple preloader for an existing swf movie. I've created a new flash document and added the Loader as well as a ProgressBar component. In the action script of the key frame 1, I implemented the following:
import mx.controls.ProgressBar;loader.contentPath = "myMovie.swf"; pBar.setStyle("themeColor", "0xF49417");pBar.setStyle("color","0x3D566F"); pBar.labelPlacement = "bottom"; pBar.label = "LOADING %3%%"pBar.scaleY = 150; pBar.conversion = 1024; pBar.source = loader; pBar.mode = "polled"; loader.load();
The problem is now that the movie starts playing (i.e. its sound) before the progress bar is completely finished. This usually happens around 80%. How can I avoid that the movie starts before the progress bar reaches 100%?