[As3] Level screen problem
|

|
there. I have a little problem with my game. I have coded a level selection screen, with 15 levels. The problem is, only the first 5 of them works, after you've completed a level.
I have added comments in the code and on the stage. Don't worry, there's not much code, so I'd really appreciate if you'd take a few minutes to look through it.
It's a bit hard to explain, but I will leave you the .swf, .fla, and code from pastebin so you can see the problem.
You can download it here: http://www.mediafire.com/fjxcbxkau61gbkq |
|
Posted On: Thursday 3rd of January 2013 10:21:39 PM |
Total Views:
267 |
View Complete with Replies
|
|
RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE
|
|

|
|

|
|

|
I have a drawing application where I want that a movie clip that follow the mouse stay always the highest position, but when you draw in the flash, the movie clip that follows the mouse is positioned below the lines. How I can get that my MC stay at the higest deep
I bring the mc to the stage with:
Code:
this.addChildAt(my_MC, 2);
and the canvas with:
Code:
addChildAt(canvas,1); |

|
VIEWS ON THIS POST
125
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hi ,
can any say what is "compile time" and "run time" And what is the difference between them |

|
VIEWS ON THIS POST
150
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
please help this is code from as2
i wanna to change it to as3
|

|
VIEWS ON THIS POST
172
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
I am having issues with my code using a slider and zoom pan:
Here is the part of the code I am having issues with....
function dragslider(e:Event):void
{
newValue = (navigator.zoomSlider.mySliderBar.x-xPoint) / fullWidth;
//do stuff here
TweenMax.to(controlledArea, 0, {scaleX:1 + (newValue *10), scaleY:1 + (newValue *10)});
zoomListenerForShowHideMapPieces(e);
keepCentered();
//zoom bubble text;
navigator.zoomSlider.mySliderBar.sliderBubble.zoom Percent.text = (Math.round(newValue *100) + " %");
navigator.zoomSlider.sliderMask.x = newValue * 100;
}
function keepCentered()
{
// monistor size
var scaleNowX:Number = 0;
var scaleNewX:Number = newValue;
var scaleNowY:Number = 0;
var scaleNewY:Number = newValue;
// Keep the screen centred
var scaleMoveX:Number = controlledArea.x-(mc_centermark.x-controlledArea.x);
var scaleMoveY:Number = controlledArea.y-(mc_centermark.y-controlledArea.y);
var zoomInX:Tween = new Tween(controlledArea,"scaleX",Regular.easeInOut,sc aleNowX,scaleNewX,2,true);
var zoomInY:Tween = new Tween(controlledArea,"scaleY",Regular.easeInOut,sc aleNowY,scaleNewY,2,true);
var scaleXMove:Tween = new Tween(controlledArea,"x",Regular.easeInOut,control ledArea.x,scaleMoveX,2,true);
var scaleYMove:Tween = new Tween(controlledArea,"y",Regular.easeInOut,control ledArea.y,scaleMoveY,2,true);
}
I am trying to get my map to zoom from center of stage. I am trying to convert this from an as2 project. I am as2 stupid.
Any hints would be awesome. |

|
VIEWS ON THIS POST
160
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
This is some great code by peter joel that alows you to drag along a custom path. I need to do the exact same thing in as3. I've been trying to do it on my own, but with no luck. I'm halfway decent with as2, i'm an as3 dummy. Can someone help please
Code:
onClipEvent(load){
var drag = false;
var error; // max number of pixels out
var tolerence = 1; // max error
var x; // current x approximation
var y; // current y approximation
var yAbove = 0; // best Approximation above line
var yBelow = 400; // best Approximation below line
}
onClipEvent(enterFrame){
if(drag){
x =_parent._xmouse;
y =_parent._ymouse;
do{
if (_root.belowLine.hitTest(x,y,true)){
yBelow = y;
y = (y+yAbove)/2;
}else{
yAbove = y;
y = (y+yBelow)/2;
}
error = yBelow -yAbove;
} while (error > tolerence);
yAbove = 0;
ybelow = 400;
_x = x;
_y = y;
}
} |

|
VIEWS ON THIS POST
124
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hi all..
When i am running my file locally it runs well but when it runs from a server, it throws an error
Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://br-pc-353:3333/_Layouts/Chann...trics_main.swf cannot load data from http://br-pc-353.proctor-test.com/Pr...2-D4221B3EE9EA.
at scripts::mainScreenClass/gettingDetails()
at scripts::mainScreenClass/show()
at scripts::main/frame6()
at flash.display::MovieClip/gotoAndPlay()
at scripts::dataMasterClass/onXMLComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
I googled a lot. I found a solution of cross domain policy funda but i am not clear with it. Anybody has ideas of getting rid of this problem..
|

|
VIEWS ON THIS POST
157
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hi
Does anyone know of a good library for making statistical graphs, such as histograms and box plots for as3. I've been looking but so far I haven't found anything really useful. |

|
VIEWS ON THIS POST
156
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
I just want this:
on (release) {
setProperty("tom", _xscale, "186");
}
on (release) {
setProperty("tom", _yscale, "186");
}
converted to as3.
Can anybody help |

|
VIEWS ON THIS POST
115
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
, I have a really cool video loaded in my flash site, but I want to stop it or remove it entirely from stage.
I'm trying this first...
Code:
var videoRequest:URLRequest = new URLRequest("videoplayer.swf");
var videoLoader:Loader = new Loader();
//this.buttonName.addEventListener(MouseEvent.CLICK, functionName);
function loadVideo():void
{
this.videoLoader.load(this.videoRequest);
this.addChild(this.videoLoader);
}
function unloadVideo():void
{
this.removeChild(this.videoLoader);
}
it does remove the videoLoader but the sounds keeps playing... so im assuming that the video is still going.... how can i kill entirely\t
please help!... |

|
VIEWS ON THIS POST
126
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
is there anyway to clean ram with as3
just to help optimize my app |

|
VIEWS ON THIS POST
165
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
I am new to as3, please help me over this.
to create empty movie clip
var mystage = stage.getChildAt(0);
var mc:MovieClip = new MovieClip();
mystage.addChild(mc);
but, where I have to set depth and the instance name, when I trace the mc.name. It shows as "instance1".
I need to set depth and to name the mc. please help me.
|

|
VIEWS ON THIS POST
153
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
,
I have a simple gallery that rearranges itself when the stage is re sized. Can anyone help me with adding a scrollbar to the browser once the stage size is small enough. I want to add a scrollbar to the browser window when the stage height is reduced below a level.
|

|
VIEWS ON THIS POST
209
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
I got this script for an xml controlled image carousel. It works really well, I just need to tweak it a bit to get it to work the way I want.
I want to position the carousel in a certain area of the movie. The only parameter that I see to control where it's positioned is "var floor:Number = 20;" but this only controls the vertical position. I need to control the horizontal position, right now it's just centered. I see "xpos3D" but don't know what to make of it.
I also want to keep it from showing up outside of the frames I want it to appear. Right now when I put the script in the movie it shows up in every frame. How do I get it appear only in certain frames of the movie When i put "stop();" at the end of the keyframe it still shows in the frames after it.
The last thing I need is to position the animation on top of other layers. Right now it appears below all other layers in the movie.
I don't know what parts to modify to accomplish this so of course I don't know what parts to post, which is why I'm posting the whole thing.
Hints on how to accomplish any of the above much appreciated!
Code:
//We use 70x70 sized images (change this if different for your images)
const IMAGE_WIDTH:uint = 70;
const IMAGE_HEIGHT:uint = 70;
//Set the focal length
var focalLength:Number = 400;
//Set the vanishing point
var vanishingPointX:Number = stage.stageWidth / 2;
var vanishingPointY:Number = stage.stageHeight / 2;
//The 3D floor for the images
var floor:Number = 20;
//We calculate the angleSpeed in the ENTER_FRAME listener
var angleSpeed:Number = 0;
//Radius of the circle
var radius:Number = 200;
//Specify the path to the XML file.
//You can use my path or your own.
var xmlFilePath:String = "3D-carousel-settings.xml";
//We save the loaded XML to a variable
var xml:XML;
//This array will contain all the imageHolders
var imageHolders:Array = new Array();
//We want to know how many images have been loaded
var numberOfLoadedImages:uint = 0;
//The total number of images according to XML file
var numberOfImages:uint = 0;
//Load the XML file.
var loader = new URLLoader();
loader.load(new URLRequest(xmlFilePath));
//We call the function xmlLoaded() when the loading is complete.
loader.addEventListener(Event.COMPLETE, xmlLoaded);
//This function is called when the XML file is loaded
function xmlLoaded(e:Event):void {
//Create a new XML object from the loaded XML data
xml = new XML(loader.data);
xml.ignoreWhitespace = true;
//Call the function that loads the images
loadImages();
}
//This function loads and creates holders for the images specified in the 3D-carousel-settings.xml
function loadImages():void {
//Get the total number of images from the XML file
numberOfImages = xml.number_of_images;
//Loop through the images found in the XML file
for each (var image:XML in xml.images.image) {
//Create a new image holder for an image
var imageHolder:MovieClip = new MovieClip();
//Create a loader that will load an image
var imageLoader = new Loader();
//Add the imageLoader to the imageHolder
imageHolder.addChild(imageLoader);
//We don't want to catch any mouse events from the loader
imageHolder.mouseChildren = false;
//Position the imageLoader so that the registration point of the holder is centered
imageLoader.x = - (IMAGE_WIDTH / 2);
imageLoader.y = - (IMAGE_HEIGHT / 2);
//Save where the imageHolder should link to
imageHolder.linkTo = image.link_to;
//Add the imageHolder to the imageHolders array
imageHolders.push(imageHolder);
//Load the image
imageLoader.load(new URLRequest(image.url));
//Listen when the image is loaded
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
}
}
//This function is called when an image is loaded
function imageLoaded(e:Event):void {
//Update the number of loaded images
numberOfLoadedImages++;
//Set the bitmap smoothing to true for the image (we know that the loader's content is a bitmap).
e.target.content.smoothing = true;
//Check to see if this is the last image loaded
if (numberOfLoadedImages == numberOfImages) {
//Set up the carousel
initializeCarousel();
}
}
//This function is called when all the images have been loaded.
//Now we are ready to create the 3D carousel.
function initializeCarousel():void {
//Calculate the angle difference between the images (in radians)
var angleDifference:Number = Math.PI * (360 / numberOfImages) / 180;
//Loop through the images
for (var i:uint = 0; i < imageHolders.length; i++) {
//Assign the imageHolder to a local variable
var imageHolder:MovieClip = (MovieClip)(imageHolders[i]);
//Get the angle for the image (we space the images evenly)
var startingAngle:Number = angleDifference * i;
//Position the imageHolder
imageHolder.xpos3D = radius * Math.cos(startingAngle);
imageHolder.zpos3D = radius * Math.sin(startingAngle);
imageHolder.ypos3D = floor;
//Set a "currentAngle" attribute for the imageHolder
imageHolder.currentAngle = startingAngle;
//Calculate the scale ratio for the imageHolder (the further the image -> the smaller the scale)
var scaleRatio = focalLength/(focalLength + imageHolder.zpos3D);
//Scale the imageHolder according to the scale ratio
imageHolder.scaleX = imageHolder.scaleY = scaleRatio;
//Set the alpha for the imageHolder
imageHolder.alpha = 0.3;
//We want to know when the mouse is over and out of the imageHolder
imageHolder.addEventListener(MouseEvent.MOUSE_OVER, mouseOverImage);
imageHolder.addEventListener(MouseEvent.MOUSE_OUT, mouseOutImage);
//We also want to listen for the clicks
imageHolder.addEventListener(MouseEvent.CLICK, imageClicked);
//Position the imageHolder to the stage (from 3D to 2D coordinates)
imageHolder.x = vanishingPointX + imageHolder.xpos3D * scaleRatio;
imageHolder.y = vanishingPointY + imageHolder.ypos3D * scaleRatio;
//Add the imageHolder to the stage
addChild(imageHolder);
}
//Add an ENTER_FRAME for the rotation
addEventListener(Event.ENTER_FRAME, rotateCarousel);
}
function rotateCarousel(e:Event):void {
//Calculate the angleSpeed according to mouse position
angleSpeed = (mouseX - vanishingPointX) / 4096;
//Loop through the images
for (var i:uint = 0; i < imageHolders.length; i++) {
//Assign the imageHolder to a local variable
var imageHolder:MovieClip = (MovieClip)(imageHolders[i]);
//Update the imageHolder's current angle
imageHolder.currentAngle += angleSpeed;
//Set a new 3D position for the imageHolder
imageHolder.xpos3D=radius*Math.cos(imageHolder.currentAngle);
imageHolder.zpos3D=radius*Math.sin(imageHolder.currentAngle);
//Calculate a scale ratio
var scaleRatio = focalLength/(focalLength + imageHolder.zpos3D);
//Scale the imageHolder according to the scale ratio
imageHolder.scaleX=imageHolder.scaleY=scaleRatio;
//Update the imageHolder's coordinates
imageHolder.x=vanishingPointX+imageHolder.xpos3D*scaleRatio;
imageHolder.y=vanishingPointY+imageHolder.ypos3D*scaleRatio;
}
//Call the function that sorts the images so they overlap each others correctly
sortZ();
}
//This function sorts the images so they overlap each others correctly
function sortZ():void {
//Sort the array so that the image which has the highest
//z position (= furthest away) is first in the array
imageHolders.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
//Set new child indexes for the images
for (var i:uint = 0; i < imageHolders.length; i++) {
setChildIndex(imageHolders[i], i);
}
}
//This function is called when the mouse is over an imageHolder
function mouseOverImage(e:Event):void {
//Set alpha to 1
e.target.alpha=1;
}
//This function is called when the mouse is out of an imageHolder
function mouseOutImage(e:Event):void {
//Set alpha to 0.3
e.target.alpha=0.3;
}
//This function is called when an imageHolder is clicked
function imageClicked(e:Event):void {
//Navigate to the URL that is in the "linkTo" variable
navigateToURL(new URLRequest(e.target.linkTo));
} |

|
VIEWS ON THIS POST
165
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
anyone know of a way to deniose / Noise Reduction or anyway to do this at runtime on a image in as3. I'm creating a image editor and need some quick advise.. |

|
VIEWS ON THIS POST
199
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hi ;
I am pretty new with AS3 . I am making a liquid layout in flash using as3,
it worked pretty well with the following code, for the movie clips that are going to be on stage from the very beginning.
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
setStage();
stage.addEventListener(Event.RESIZE, stageResize);
function setStage():void
{
var WIDTH:Number = stage.stageWidth;
var HEIGHT:Number = stage.stageHeight;
demon_mc.x = WIDTH/2 - 50 ;
devil_mc.x = WIDTH/2 + 280;
}
But when I try to load a movie clip by clicking a button and using the ddEventListener , it dose load, but doesn't float
here is the code that I think have some problem:
demon_mc.addEventListener(MouseEvent.CLICK, getSlider);
function getSlider(event:MouseEvent):void
{
var myMovieClip:MovieClip = new galleryBg_mc();
addChild(myMovieClip);
stage.scaleMode = StageScaleMode.NO_SCALE;
setStage();
stage.addEventListener(Event.RESIZE, stageResize);
function setStage():void
{
var WIDTH:Number = stage.stageWidth;
var HEIGHT:Number = stage.stageHeight;
myMovieClip.x = WIDTH/2;
myMovieClip.y =330;
}
}
as you can see I have defined the variables Width adn Height inside the function as well and I am using WIDTH/2 to define the x position,
Well it laods in the exact position but won't float as I minimize the stage
Thankx a loooooooooooot |

|
VIEWS ON THIS POST
179
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hi ,
I'm trying but I can't work this out.
I have a single movieclip named button, and I want to use a "for" to multiply that movieclip, that way I can have multiple buttons and edit them all in a single function.
It would be something like this:
var _button = new button;
for(i=0; i |

|
VIEWS ON THIS POST
208
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Can anyone point me to a decent full screen flash gallery tutorial (perhaps xml) with thumbnails.
Much appreciated.
Phil |

|
VIEWS ON THIS POST
242
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
I would like to look at some sources for a slideshow populated by xml data. There's plenty online but I can't find one that first populates a slider menu with thumbnails from which you can choose an individual picture to see enlarged at a different place on stage. Does anyone know links for these sources
Thank you. Apologies if this is an annoying request, I've been looking online for some time and don't seem to get anywhere, I think I don't know the right terms for the search. |

|
VIEWS ON THIS POST
209
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hy ,
I use this function to start the music in my project
function tocar() {
soundFactory.addEventListener(Event.COMPLETE, completeHandler);
soundFactory.addEventListener(IOErrorEvent.IO_ERRO R, ioErrorHandler);
soundFactory.addEventListener(ProgressEvent.PROGRE SS, progressHandler);
soundFactory.load(request);
song = soundFactory.play(); }
--------------------------------------------------------------------------
Now i wana low volume of the music. I thought it was something like song.volume = 90; but i was wrong :p
Can u help me on this\t |

|
VIEWS ON THIS POST
190
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
So i've been handed a nice little project from my boss. He wants an interactive flash panel that will rotate through several twitter accounts. Anyone have an idea of where i should start. much |

|
VIEWS ON THIS POST
227
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
This must have been done before and be really easy but I am a newbie so just keep coming up with compiler errors.
I have built a website in flash cs4 using as3. I have set up the time line so that each different page on the website exists at a different position on the timeline. Sections have been labeled so that I can jump to that section upon button click.
What happens is when the link to the page/section is clicked the timeline jumps to that section and plays an animation that animates the page onto the stage then stops.("in animation")
When you click another link the page should animate off of the stage ("out animation")and the next one animates in.
(I have set the time line up so that after each "in" animation there is a stop and after each "out" animation there is a stop.)
This is where i'm having the problem.
I have set up event listeners for the button clicks But i can only get them to either play the "out" animation then that stops, using this code:
Code:
home.addEventListener(MouseEvent.CLICK, clickSection);
about.addEventListener(MouseEvent.CLICK, clickSection);
contact.addEventListener(MouseEvent.CLICK, clickSection);
function clickSection(evtObj:MouseEvent)
{
play();
}
or jump to the next section using this code:
Code:
home.addEventListener(MouseEvent.CLICK, clickSection);
about.addEventListener(MouseEvent.CLICK, clickSection);
contact.addEventListener(MouseEvent.CLICK, clickSection);
function clickSection(evtObj:MouseEvent)
{
gotoAndPlay(evtObj.target.name);
}
What i would like to know is how to add the two together so that when a button is clicked the information about what was clicked is added to a variable. The function plays the out animation then when that is complete checks the variable where the page clicked information is then jumps to that section on the timeline and plays it's "in" animation
Sorry for the long explanation, but I thought more facts would be better than less
Jamie |

|
VIEWS ON THIS POST
216
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
how i can initialize the Blur Filter value in as3 pls help |

|
VIEWS ON THIS POST
241
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hi.
I made a .as Class where some graphical elements are spawned into the stage.
However, the Flash (.fla) have some internal graphics that are supposed to be over the graphical elements spawned from the custom class.
I tried to make another layer over the layer where the as3 Class is being called, but unfortunately it doesn't do anything, the graphic from the .as still appearing over the internal .fla graphics.
How I can make sure the .FLA graphics are appearing over the .as3 graphics
(Am I clear)
|

|
VIEWS ON THIS POST
184
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Can someone please help me figure out how to load .swf in a way that AS2 did it with levels . This was easy in AS2.
I have 15 movies whch are supposed to load on user click (simple Next button), and this was a no brainer in AS2 with level_0, but in AS3 im aware this works differently, and i cant find a simple solution in documentation.
any tip is greatly apreciated
adrian |

|
VIEWS ON THIS POST
80
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Code:
var library:XML=;
library.book = ;
library.book.@bookID = 124;
library.book.(@bookID = 124).page.@pageNumber = 1;
library.book.(@bookID = 124).page.@pageNumber = 2;
library.book.(@bookID = 124).page.@pageNumber = 3;
trace(library);
// this traces:
//
//
//
//
//
I would like my book to have three pages... anyone with a big brain have some ideas
Ps - trying to do it without a loop |

|
VIEWS ON THIS POST
194
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Kirupians!
[Summary ]
I don't know if anybody had already encountred this bug, but, it seems that kaspersky in IE6 doesn't like the opening of popup windows by flash's as3.
ExternalInterface.call ("function setWMWindow() {window.open('" + url + "', '" + target + "', '" + features + "');}");
[SYMPTOMS ]
i know that many browsers have isues with mouse events used in buttons to triger url opening, that's why i use MouseEvent.CLICK for caling the above code.
[MORE INFORMATION ]
when i disable kaspersky evrything works fine in all tested browsers; FF, IE..
Thanx for reading! |

|
VIEWS ON THIS POST
220
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
hello,
i just setup this loader i found on the net:
Code:
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("world.jpg"));
function loop(e:ProgressEvent):void{
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString();
}
function done(e:Event):void{
removeChildAt(0);
percent = null;
addChild(l);
}
what i dont understand is that everytime i click the refresh page the loader shows up again(this time loading the image faster) but if the image is already in cache the loader should not show at all (), i would like to achieve a loader that loads the image and after dont come up again everytime. |

|
VIEWS ON THIS POST
226
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hi all,
I want to create a set of buttons based on loaded images from xml that onClick turn red or grow in size, whatever, Clicking another turns that button red and the old one back to default. Alsoo it will attach a animated movieclip onclick to the button and when pressing another button, it swifts to that button.
Code:
var tracktype:Array = new Array;
var imgArray:Array = new Array;
var links:int;
var locx:Array = new Array;
var locy:Array = new Array;
var loc:Array = new Array;
var lname:Array = new Array;
function showXML(e:Event):void
{
XML.ignoreWhitespace = true;
var sitemap:XML = new XML(e.target.data);
links = sitemap.link.length();
var i:int = 0;
for (i = 0; i < links; i++)
{
loc.push(sitemap.link.loc[i].text());
locx.push(sitemap.link.locx[i].text());
locy.push(sitemap.link.locy[i].text());
tracktype.push(sitemap.link.tracktype[i].text());
lname.push(sitemap.link.name[i].text());
if (mapEnabled)
{
var loader:Loader=new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, GenerateSpots);
loader.load(new URLRequest("images/hotspots/"+ tracktype[i]+".png"));
}
}
}
}
function GenerateSpots(event:Event):void
{
imgArray.push(event.currentTarget.loader);
if(imgArray.length==links)
{
for(var n:int=0;n |

|
VIEWS ON THIS POST
223
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hiya folks. This is may be a silly question, but bare with me.
I am currently using flashdevelop for my "home" work, but to be honest having gotten used to the benefits of eclipse at work i am finding flashdevelop a bit lacking. Mainly the ability to use breakpoints and watch the flash step through process by process and keep track of variables and accessible properties.
I basically want to replace flashdevelop with eclipse, (i am not using flex), and i'd like to keep the ability that flashdevelop has to integrate easily with the flash ide (for quick running of the app with ctrl enter, and also for easy integration of the flash ide's library).
I am thinking maybe this isn't possible, but i hope it is because it would be an insanely good development environment.
Any thoughts |

|
VIEWS ON THIS POST
194
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
hello.
is it possible to read the iptc metadata of a jpeg loaded with as3 |

|
VIEWS ON THIS POST
172
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hi! If I change some 3d property via as3, how do set the global/local option usually available under the tools palette Is there a way |

|
VIEWS ON THIS POST
216
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Hi . here is a wierd one for you. I cant get my head around it. Im trying to create an animated carosel type thing. I have a main class that loads xml and then external images into a class I called Image which is just really a wrapper for Loader. I have a previous and next buttons that use array methods to move the Image instances around in an array and then sends the correct Image to 3 classes that represent my 3 image positions in my carousel.
Heres the important snippet in my main class:
Code:
private function onPrev(e:MouseEvent):void {
_images.unshift(_images.pop());
for (var i:int = 0; i |

|
VIEWS ON THIS POST
168
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Can you please give me the best sites/examples of as3 application.. |

|
VIEWS ON THIS POST
168
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
!
The thing is i'm trying to make an effect that emmulates hanging interactive objects so that when the user hits any object it moves according to the mouse position and speed.
My problem is that i cant find the way to apply the tension and the "pendulum" kind of movement so it looks natural.
any thoughts
thanx alot! |

|
VIEWS ON THIS POST
112
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
So I'm playing around with xml and as3.
Now I got this:
Code:
var fileList:XMLList = bookInput.Songs.file1;
And now I want that if you push a button, file1 changes in file2.
So I got this:
Code:
var j:uint=1;
But when I change the first snipped in this:
Code:
var fileList:XMLList = bookInput.Songs.file+j;
it gives this error:
TypeError: Error #1034: Type Coercion failed: cannot convert "1" to XMLList.
How to fix it |

|
VIEWS ON THIS POST
196
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Does anyone have an example of a horizontal drop down menu using AS3
|

|
VIEWS ON THIS POST
84
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Apologies if this is the wrong place for my thread.
I've happily been using ActionScript 2 for a very long time now, and am very comfortable with it. Whenever I even try to use AS3, the amount of Syntax errors I come across is overwhelming. So I always end up resorting back to AS2. I like to think "if it ain't broke, don't fix it".
However, after slowly watching some of the amazing potential AS3 has to offer; I think it's time I move on, and get with the times.
So I ask you, are there any handy websites or tutorials you can guide me to, that specifically deal with people trying to wean themselves off AS2 and onto AS3. Distinct things that are now missing from AS2, or common Syntax error resolutions.
My AS2 knowledge is good, and all I can find out there for AS3 is either extremely different, or far too advance. I just hope AS3 really isnt that different
Thank you. |

|
VIEWS ON THIS POST
85
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Opening a new window in as3 triggers popup blockers on some browsers. How do I get around this problem
I need a solution that will work on all browsers and all minor versions of Flash player 9. Like it worked in AS2 with:
on(release) { getURL("http://www.adobe.com", "_blank"); }
I have done some testing with different ways of opening a new window and with different "wmode"s. But have not found a generic solution that will work on all browsers. To many are blocked by browsers popup blocker. Anyone out there got a solution for me Adobe
I have also set up a testpage for checking different browsers. Take a look here:
http://kunde.apt.no/paal/
Also check out the results from my testing here (green is OK, red is blocked):
http://kunde.apt.no/paal/results.html
|

|
VIEWS ON THIS POST
77
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
hello
i've been trying to rewrite this code (it's from flash 8 tutorial) in as3. the problems started with phrasing xml file. here's what i did so far.
Code:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadXML);
loader.load(new URLRequest("menu_nav.xml"));
var ID:Array = new Array;
var DisplayName:Array = new Array;
var LinkType:Array = new Array;
var LinkValue:Array = new Array;
var topMenuNum = 0;
function loadXML(e:Event):void
{
var xml:XML = new XML(e.target.data);
trace ("the number of total children is... " + xml.children().length());
var i = 0;
while ( i < xml.children().length()) {
ID.push(xml.children()[i].attributes()[0]);
DisplayName.push(xml.children()[i].attributes()[1]);
LinkType.push(xml.children()[i].attributes()[2]);
LinkValue.push(xml.children()[i].attributes()[3]);
if (ID[i] == "TM") {
topMenuNum = topMenuNum +1;
}
i = i +1;
}
trace ("the total number of top menu items is... " + topMenuNum);
}
now i have some serious problems with this part (it should be before i=i+1). it's to keep track of how many submenu items there will be.
Code:
set ("submenu_Finish_" + ID[i] , i);
if ( eval(".submenu_Start_" + ID[i]) == undefined )
{
set ("submenu_Start_" + ID[i] , i);
Total_subs = Total_subs + 1;
}
set ("Total_Items_in_Submenu_" + ID[i] , eval( "submenu_Finish_" + ID[i]) - eval( "submenu_Start_" + ID[i]) + 1);
there was _global in front of every variable. i removed it coz i dont think it would affect the code at this point |

|
VIEWS ON THIS POST
108
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
hi I came across this awsome class created by pixelfumes called an active blur class. they offer up the source files on there site. the class is written in as2; however, I am trying to convert it to as3 but I am having troubles doing so. can anyone help me.
here is a link to an example of what it is I want to acheive.
http://www.pixelfumes.com/blog/apr07...BlurClass.html
and here is a link to the source files
http://pixelfumes.blogspot.com/searchq=active+blur |

|
VIEWS ON THIS POST
76
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
I've just jumped from as2 to as3 and it's quite depressing to see I have lots to do to fix everything to work.
I have an as file containing loads of functions and commands and I used to link it to the flash file with #include in a frame. That obviously don't work anymore.
I tried to search and read about this and find myself puzzled with the class and package.
So to replace the include, do I just write the frame:
import myPackage.myCode;
and wrap my code inside:
package myPackage{
public class myCode {
code here...
}
Or how will I do the same thing I used to in as2
I tested the example of the help file.
In te as file i wrote:
package samples
{
public class SampleCode
{
public var sampleGreeting:String;
public function sampleFunction()
{
trace(sampleGreeting + " from sampleFunction()");
}
}
}
and in the main timeline I tried both:
import samples.*;
import samples.SampleCode;
Both gave error:
1172: Definition samples could not be found.
1172: Definition samples:SampleCode could not be found.
And I had one component button in the maintimeline (left from previous test) and when testing movie it flickered showing all the buttons states below each other\t\t |

|
VIEWS ON THIS POST
93
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
,
I working long time in actionscript 2.0. just now i started working in action script 3.0. The script what i have pasted down is working in as2.
stop();
click_btn.onPress = function() {
gotoAndPlay(1);
};
But the same script is not working in as3.
I don't know y.please tell me.
And also tell what is the differents between actionscript2.0 and actionscript3.0 |

|
VIEWS ON THIS POST
122
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
I found the Senocular tutorial to do a contdown in as2, i try to convert, but im starting in action scritp and the code give me a bunch of error, can someone help me.
PHP Code:
stop();currentDate=newDate();thisYear=currentDate.getFullYear();eventDate=newDate(thisYear,11,25);eventMillisecs=eventDate.getTime();counter.onEnterFrame=function(){currentDate=newDate();currentMillisecs=currentDate.getTime();this.msecs=eventMillisecs-currentMillisecs;if(this.msecs |

|
VIEWS ON THIS POST
105
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
Made in AS2, 24 fps
http://www.patrickjansen.net/test/___as2.html
Made in AS3, 24 fps
http://www.patrickjansen.net/test/___as3.html
The AS2 animation plays faster then the AS3 animation.
They're relatively the same in structure, so it boggles me why as2 plays better then as3.
weird... |

|
VIEWS ON THIS POST
70
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
could someone please explain how to send variables to a php file using actionscript 3 im trying to create a contact form with flash and all the online tutorials i have found use as2.
any help would be much appreciated! |

|
VIEWS ON THIS POST
71
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
bitmapData.dispose() |

|
VIEWS ON THIS POST
112
|

|
Posted on:
Thursday 25th October 2012
|
View Replies!
|
|

|
|

|
,
I need help on this following syntax to translate it into looping, as I will use it for a lot more movie clips. Please help me. Urgent T_T
var xPos:int;
var yPos:int;
var xPosK:int;
var yPosK:int;
nextbtn.visible=false;
ndragbtn.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);
ndragbtn.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);
kdragbtn.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_4);
kdragbtn.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_4);
submitbtn.addEventListener(MouseEvent.CLICK, submit);
nextbtn.addEventListener(MouseEvent.CLICK, nextrandom);
homebtn.addEventListener(MouseEvent.CLICK, home);
function getPosition(ndragbtn):void
{
xPos = ndragbtn.x;
yPos = ndragbtn.y;
}
function getPosition1(kdragbtn):void
{
xPosK = kdragbtn.x;
yPosK = kdragbtn.y;
}
function fl_ClickToDrag_3(event:MouseEvent):void
{
getPosition(ndragbtn);
ndragbtn.startDrag();
}
function fl_ClickToDrag_4(event:MouseEvent):void
{
getPosition1(kdragbtn);
kdragbtn.startDrag();
}
function fl_ReleaseToDrop_3(event:MouseEvent):void
{
if (ndragbtn.hitTestObject(ndragbtnTarget))
{
ndragbtn.x = ndragbtnTarget.x;
ndragbtn.y = ndragbtnTarget.y;
ndragbtnTarget=ndragbtn;
}
else if(ndragbtn.hitTestObject(kdragbtnTarget))
{
ndragbtn.x = kdragbtnTarget.x;
ndragbtn.y = kdragbtnTarget.y;
}
ndragbtn.stopDrag();
kdragbtn.stopDrag();
}
function fl_ReleaseToDrop_4(event:MouseEvent):void
{
if (kdragbtn.hitTestObject(kdragbtnTarget))
{
kdragbtn.x = kdragbtnTarget.x;
kdragbtn.y = kdragbtnTarget.y;
kdragbtnTarget=kdragbtn;
}
else if(kdragbtn.hitTestObject(ndragbtnTarget))
{
kdragbtn.x = ndragbtnTarget.x;
kdragbtn.y = ndragbtnTarget.y;
}
kdragbtn.stopDrag();
ndragbtn.stopDrag();
}
function submit(event:MouseEvent):void
{
if(ndragbtn == ndragbtnTarget && kdragbtn == kdragbtnTarget)
{
statustxt.text="Correct and you can proceed!";
nextbtn.visible=true;
}
else{
statustxt.text="Sorry please try again!";
ndragbtn.x = xPos;
ndragbtn.y = yPos;
kdragbtn.x = xPosK;
kdragbtn.y = yPosK;
}
}
I do appreciate a quick reply from u |

|
VIEWS ON THIS POST
45
|

|
Posted on:
Monday 31st December 2012
|
View Replies!
|
|

|