Problem with parent


Ok, I cannot figure this out. I have a custom Class that extends Movieclip called Nav, and a container clip on stage. I've referenced the Nav Class and called it as such:

import com.Nav;

public var navigation:Nav;

navigation = new Nav();
container.addChild(navigation);


This works fine. But when I try to access it with container.navigation ANYTHING it doesn't recognize it. I CAN access it as simply "navigation." But this shouldn't be the case.

I cannot figure this out for the life of me and it's driving me crazy. It should be the other way around, and navigation should not be accessible WITHOUT container.
Posted On: Thursday 3rd of January 2013 10:21:29 PM Total Views:  309
View Complete with Replies

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




Help with a simple scrollbar class...

I've written a basic scrollbar class (still learning how to structure a class) and it works OK but there's a bug and I'm not sure how to fix it. The problem occurs when defining the boundaries of the bar that drags up and down the slider. Everytime the mouse is clicked, the boundaries are reset, allowing the drag movieclip to travel beyond where I want it to go. How can I fix this\t Here's what I've written: package { import flash.events.Event; import flash.geom.Rectangle; import flash.events.MouseEvent; import flash.display.MovieClip; public class ScrollBox extends MovieClip { public function ScrollBox() { drag.buttonMode = true; drag.addEventListener(MouseEvent.MOUSE_DOWN, dragMouseDown); } public function dragMouseDown(evt:MouseEvent):void { var bounds:Rectangle = new Rectangle(drag.x,drag.y,0,scrollBar.height - drag.height); drag.buttonMode = true; drag.startDrag(false,bounds); stage.addEventListener(MouseEvent.MOUSE_UP, dragMouseUp); addEventListener(Event.ENTER_FRAME, scrollText); } public function dragMouseUp(evt:MouseEvent):void { drag.stopDrag(); stage.removeEventListener(MouseEvent.MOUSE_UP, dragMouseUp); removeEventListener(Event.ENTER_FRAME, scrollText); } public function scrollText(evt:Event):void { var percentScrolled:Number = (drag.y - scrollBar.y) / (scrollBar.height - drag.height); container_mc.y = percentScrolled * (scrollBar.height - container_mc.height) + scrollBar.y; } } }
VIEWS ON THIS POST

66

Posted on:

Monday 29th October 2012
View Replies!

scrolling thumbs gallery offset

hi , i'm currently re-using a code snippet of xml gallery with scrolling thumbs, but i got a problem : my mask is stagewidth and my pictures holder width depend of thumbs numbers, sometimes after resizing windows browser, while scrolling to the browser sides limit i cannot see the end of the last pic or the start of the first pic, how to fix that tha'ts part of a bigger project, but i've isolated the bug in this source : http://missjohanna.free.fr/scrollbug.zip the fix i would like : -seeing the whole first pic and whole last pic when scrolling to the border left and right -placing the first pic at x:70 at start, and enter fullscreen i've tried many thing, but unfortunately, due to my poor as3 knowledge i cannot figure out how to fix that.. if someone may have a look on this , that's only a 2 mn fix for a skilled as3 programmer, but for me a headache
VIEWS ON THIS POST

60

Posted on:

Monday 29th October 2012
View Replies!

1009...again. How to initialize the stage?

I'm running through my code and when the program runs, it gets to the line of code that says "stage.addChild(mainGrid)", it simply gives me the same old 1009 error. Been scratching my head for days now.
VIEWS ON THIS POST

67

Posted on:

Monday 29th October 2012
View Replies!

Flash External.swfs with Buttons

Hi . Im new to Flash and really enjoying the challenges and rewards of working with this software. But recently I ran into a problem thats been giving my headaches for the past few weeks, What Im after is a website that will load and unload external .swfs from the navigation bar which Ive achieved and this works well, The problem is when I put a button in one of the externally loaded .swf to load another no luck. I have attached a scaled down version of the site Im working towards, my problem begins at the my Gallery page which has the buttons on it and id like to link these buttons to the .swfs of the same name and after also have Previous and Next function to go back and forward between the gallery pages.
VIEWS ON THIS POST

71

Posted on:

Monday 29th October 2012
View Replies!

cacheAsBitmap question

i guess im dong this wrong... i create movieclips up front. cache them as bitmap. when i add and remove them from the display list, there is a slight stutter/pause. If i don't cache them as bitmap, there is no stutter when adding/removing child . So my assumption is that its re-caching them each time they are re-added. how do i keep them cached so i can remove them from the display list, but keep it in memory for later I will add i am doing this on a phone with air/android, i dont think that makes a difference, but my cpu is to powerful to see the stutter. i tried cacheAsBitmap and cacheAsBitmapMatrix and both
VIEWS ON THIS POST

52

Posted on:

Monday 29th October 2012
View Replies!

Flash click on color button and write in textarea with that color font

hi I want to do as follows: * click a "red" button * write in textarea with red color font * click "blue" button * write in textarea with blue color font Isn't this possible in flash 10 using AS3 \t\t\t I tried using setTextFormat but the problem is i have to have text before inserting format on that. Please somebody tell me how to do this\t\t
VIEWS ON THIS POST

74

Posted on:

Monday 29th October 2012
View Replies!

Flash CS5 - Air 2 - local file access

I'm sorry if this is addressed somewhere, but I did try to find it. I have a Flash project that plays FLVs from (http://) sources and it works fine when I publish it as AIR 2. I want to save and access my FLVs locally, but I can't seem to get it to work. I don't know if it is a matter of the correct path syntax, I'm also not sure what an Air app sees as a relative path. Does anyone know what it should look like in as3 This is what it looks like for http: stream.play("http://domain.com/subdir/file.flv") How do I make this local
VIEWS ON THIS POST

53

Posted on:

Monday 29th October 2012
View Replies!

stop user from spamming a button

I have a little turn-based combat app where I use a Timer so enemy units can attack in sequence, and to allow time for animations to play. Works great for them. But if the user hits the attack button too rapidly, friendly units miss there turn. I tried inserting a toggling Boolean var and saying "It's not your turn!" when you click to attack. That works, there is indeed a text prompt, but friendly units still miss turns. Any techniques to address this welcome, especially if they don't involve a Timer. Or if you can point me to a thread. I tried searching for button and click, but with no luck.
VIEWS ON THIS POST

50

Posted on:

Monday 29th October 2012
View Replies!

Math Opperators in RegExp

I'm having an issue with RegExp. I have a string variable equal to "1 + 2 + 3 + 4". I'm trying to use RegExp to replace that string inside another string, however the plus signs are causing it to not be recognized. If I take the plus signs out, it works. If I replace the plus signs with minus signs, it works. I know + means something in an expression, is there a way I can get flash to ignore it and keep the + sign in there
VIEWS ON THIS POST

48

Posted on:

Monday 29th October 2012
View Replies!

Help on codes.

Basically i need help with this 2 sets of codings to make the object fly at random places but instead it does not fly but blink instead. Food is the object i wan to make it move and 123 is the main class. Food Codes: package { import flash.display.MovieClip; import flash.events.*; public dynamic class Food extends MovieClip { private var xSpeed:Number = Math.random() * 10; private var ySpeed:Number = Math.random() * 10; public function Food() { this.addEventListener(Event.ENTER_FRAME, scurry); this.gotoAndStop(Math.ceil(Math.random()*4)); } public function scurry (e:Event) { if (this.x < 0 || this.x > 550) { this.xSpeed *= -1; } if (this.y < 0 || this.y > 400) { this.ySpeed *= -1; } this.x += this.xSpeed; this.y += this.ySpeed; } public function die() { this.removeEventListener(Event.ENTER_FRAME, scurry); parent.removeChild(this); } } } 123 Codes: package { import flash.display.Sprite; import flash.events.*; import flash.utils.Timer; import flash.text.*; public class 123 extends Sprite { private var count:uint; private var prevCount:uint; private var timer:Timer; private var scoreText:TextField; private var score:uint; public function 123 () { init(); } private function init():void { var food:Food = new Food(); food.x = Math.random() * stage.stageWidth; food.y = Math.random() * stage.stageHeight; addChild(food); count ++; stage.addEventListener(MouseEvent.MOUSE_DOWN, kill); timer = new Timer(5000); timer.addEventListener(TimerEvent.TIMER, addFoods); timer.start(); scoreText = new TextField(); scoreText.x = 500; scoreText.y = 10; scoreText.width = 200; addChild(scoreText); } private function kill (e:MouseEvent):void { if(e.target is Food) { e.target.die(); score += 10; scoreText.text = score.toString(); } } private function addFoods(e:TimerEvent) { prevCount = count; count += count; for (var i:uint = prevCount; i < count; i++) { var food:Food = new Food(); food.name = "food" + i; food.x = Math.random() * stage.width; food.y = Math.random() * stage.height; addChild(food); } infested(); } private function infested() { if (numChildren > 250) { timer.stop(); var i:int = this.numChildren; while(i--) { removeChildAt(i); } addChild(scoreText); } } } }
VIEWS ON THIS POST

53

Posted on:

Monday 29th October 2012
View Replies!

Parsing XML

I have been through the tutorials but am having trouble parsing my xml file. I am working with an xml file from an epub book. The file looks like this: The Adventures of Sherlock Holmes Chapter 1 To Sherlock Holmes ... I had ... var testLoader:URLLoader testLoader=new URLLoader(new URLRequest("file.xml")); testLoader.addEventListener(Event.COMPLETE, xmlTestDownloaded); function xmlTestDownloaded(event:Event):void { var xmlData:XML=new XML(event.target.data); trace(xmlData); } The trace here will spit out all of the file so I know it is loading. However, I've tried everything I can think of to get the and sections, but I do not seem to get anything.
VIEWS ON THIS POST

67

Posted on:

Monday 29th October 2012
View Replies!

Load images based on array position

I've searched for ages on this and I can't see how it's done, so please help! I've got a set of images in my library and each one has been "exported for actionscript" with class names of stim1, stim2...stim12. Now, I have a bit of actionscript code that creates instances of these classes and will load the stimuli to the stage: Code: var BitmapDataLeft:stim1 = new stim1(150,150); var imageLeft:Bitmap = new Bitmap(BitmapDataLeft); addChild(imageLeft); What I would really like to do, however, is load an image based on the current status of a variable. So for example I've got an array that has all the image names in it, and a counter called "trialCount". When this is at 6, I'd like to present item 6 (i.e. cueNames[trialCount]). How do I merge that with my image loading code Or, if it makes more sense, is there a way to create an array of images\t many
VIEWS ON THIS POST

57

Posted on:

Monday 29th October 2012
View Replies!

objects added to the stage in a circle formation

all, I want to add my objects onto the stage in a perfect circle (regardless of their quantity) much like this: http://www2.edc.org/makingmath/maths...ect/Image2.gif What would be the math formula for this
VIEWS ON THIS POST

88

Posted on:

Monday 29th October 2012
View Replies!

Glowfilter not working on textfiled?

I have four instances of a movieclip (consisted of a textfield) on stage with given names btn1,btn2,btn3,btn4. The issue is I cannot get the GlowFilter work on ROLL_OVER event Listener. PHP Code: importcom.greensock.*;importcom.greensock.easing.*;varbuttons_array:Array=[btn1,btn2,btn3,btn4];varpreviousBtn=MovieClip(buttons_array[0]);previousBtn.mouseEnabled=false;TweenMax.to(previousBtn,0,{tint:0xCAB16F});for(vari:Number=0;i
VIEWS ON THIS POST

56

Posted on:

Monday 29th October 2012
View Replies!

Scrollbar messing up focusOut in textfield

. I have a simple textfield with the text "Enter Name". On focusIn it removes the text and on focusOut it adds the text again(that is if you did not change it). The problem occurs when I add a scrollbar from the scrollbar class. Then suddenly my focusOut stops working. I don't know what's causing this. If I just comment this line: //this.addChild(sb); Then it works so I know that it has something to do with the scrollbar. I post my code here, but also attach the fla file in a zip for download here: http://www.actionscript.org/forums/a...9&d=1268839495 I appreciate the help I can get Thank you. /Dudde Code: import fl.controls.ScrollBar; import fl.events.ScrollEvent; import fl.controls.ScrollBarDirection; var nameSet:Boolean; var listname_txt:TextField = new TextField(); listname_txt.border = true; listname_txt.borderColor = 0x000000; listname_txt.background = true; listname_txt.backgroundColor = 0xFFFFFF; listname_txt.type = TextFieldType.INPUT; listname_txt.x = 5; listname_txt.y = 5; listname_txt.width = 250; listname_txt.height = 19; listname_txt.text = "Enter Name"; addChild(listname_txt); listname_txt.addEventListener("focusIn", listname); function listname(event:Event){ if(nameSet==false){ listname_txt.replaceText(0,listname_txt.length,""); } } listname_txt.addEventListener("focusOut", listname2); function listname2(event:Event){ if(listname_txt.length>0){ nameSet=true; }else { listname_txt.appendText("Enter Name"); nameSet=false; } }
VIEWS ON THIS POST

62

Posted on:

Monday 29th October 2012
View Replies!

load image issue

, I'm stuck. I keep getting three images in the transition instead of probably two. Should I be deleting something in the code Code: import fl.transitions.*; import fl.transitions.easing.*; var loader_mc:Loader; var loader_xml:URLLoader = new URLLoader(); var strXML:String = "pics.xml"; var loader_url:URLRequest = new URLRequest(strXML); var loader_urlpic:URLRequest; var strImg:String; var strImgNew:String; var arrPics:Array; var arrActualAdds:Array = new Array(); var pics:XML; var numIMG:Number; var timeTimer:Timer = new Timer(5000); var perCount_num:Number = 0; var totCount_num:Number; timeTimer.addEventListener("timer", timeTimerA); // Delay var timeDelay:Timer = new Timer(15000); timeDelay.addEventListener("timer",timeTimerB); with(loaderbaby_mc) { x = 0; y = 0; } function loadImage(url:String):void { loader_mc = new Loader(); loader_mc.load(new URLRequest(url)); loader_mc.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading); loader_mc.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded); } function imageLoaded(e:Event):void { loaderbaby_mc.addChild(loader_mc); } function imageLoading(e:ProgressEvent):void { } function funcEaseOut(loaderbaby_mc:MovieClip) { var myTweenAlpha:Tween = new Tween(loaderbaby_mc, "alpha", Strong.easeOut, .5, 1, 3, true); } function funcEaseIn(loaderbaby_mc:MovieClip) { var myTweenAlpha:Tween = new Tween(loaderbaby_mc, "alpha", Strong.easeIn, 1, 0, 3, true); } function showXML(e:Event):void { XML.ignoreWhitespace = true; pics = new XML(e.target.data); trace(pics.pic.length());//Result is 4 numIMG = pics.pic.length(); // trace(pics.pic[0].@thing); for(var i_num:Number = 0; i_num < numIMG; i_num++) { arrActualAdds[i_num] = pics.pic[i_num].@thing; // trace(arrActualAdds[i_num] + "is pic " + i_num); } strImg = arrActualAdds[0]; funcEaseOut(loaderbaby_mc); loadImage(strImg); totCount_num = arrActualAdds.length; trace(totCount_num + "= Total Count Number"); timeDelay.start(); /* strImg = arrActualAdds[0]; */ /* loader_urlpic = new URLRequest(strImg); loadImage(strImg); */ } function timeTimerB(eventArgs:TimerEvent):void { timeTimer.start(); // timeDelay.removeEventListener (TimerEvent.TIMER, timeDelay); } function timeTimerA(eventArgs:TimerEvent):void { timeDelay.stop(); /// trace("==============================================="); perCount_num += 1; if(perCount_num < totCount_num) { // trace("It's Lesser"); // leave it alone // trace(perCount_num); }else if(perCount_num == totCount_num) { //trace("It's Greater"); perCount_num = 0; // trace(perCount_num); } strImgNew = arrActualAdds[perCount_num]; /* trace(strImgNew + " = " + perCount_num); trace("==============================================="); */ loadImage(strImgNew); funcEaseOut(loaderbaby_mc); } /* add one value and change the picture*/ loader_xml.addEventListener(Event.COMPLETE, showXML); loader_xml.load(loader_url); //loadImage("image30.jpg");
VIEWS ON THIS POST

57

Posted on:

Monday 29th October 2012
View Replies!

Keyboard events not getting all keys AS3

So I have a problem, approximately half the keys on my keyboard are not traced, including the A, S and Return keys required by the game I am writing, here is the keyDownListener function, I am almost certain the actual code is correct, but am hoping someone can enlighten me on an error or of a problem with flash that causes this function keyDownListener(e:KeyboardEvent):void { trace(e.keyCode) if(e.keyCode == LEFT) { keyPressedLeft = true; } if(e.keyCode == UP) { keyPressedUp = true; } if(e.keyCode == RIGHT) { keyPressedRight = true; } if(e.keyCode == DOWN) { keyPressedDown = true; } if(e.keyCode == W) { keyPressedW = true; } if(e.keyCode == A) { keyPressedA = true; } if(e.keyCode == S) { keyPressedS = true; } if(e.keyCode == D) { keyPressedD = true; } if(e.keyCode == RETURN) { keyPressedReturn = true; } }
VIEWS ON THIS POST

64

Posted on:

Wednesday 7th November 2012
View Replies!

Rotary knob

Not hard to do... create a movieclip of the knob you want to use, then you can rotate it based on whatever interactivity you dee. Maybe you have little dots at different points, or lines, representing a stove... you can target the movieclip to rotate to that point via the rotate property. Show some effort with writing some code.
VIEWS ON THIS POST

59

Posted on:

Wednesday 7th November 2012
View Replies!

how do you do water effects to scripted drawings?

I am having problems with apllying watter effects to scripted drawing. no errors found. how would i apply a ripple effect to a scripted drawing. scripted drawing. import flash.display.Sprite; import flash.display.Graphics; var myMathGame:ToRipple = new ToRipple(); var shapes:Sprite = new Sprite (); var gr:Graphics = shapes.graphics; gr.lineStyle(); gr.beginFill(0x0000FF,0xFFFFFF) gr.drawRect(0,5,100,100); gr.endFill(); shapes.x = 0; shapes.y = 10; addChild(shapes); scripted drawing package { import flash.display.Bitmap; import flash.display.Sprite; import flash.events.MouseEvent; import flash.display.BitmapData; import flash.utils.Timer; import flash.events.TimerEvent; public class ToRipple extends Sprite { private var myRippler:Rippler; var rippleTarget:Bitmap; public function Ripple() { var rippleBitmap:BitmapData=new BitmapData(640,480,false,0); var ripplePicture:toRipple=new toRipple(); var timer:Timer=new Timer(100); timer.start(); rippleBitmap.draw(ripplePicture); rippleTarget=new Bitmap(rippleBitmap); addChild(rippleTarget); myRippler=new Rippler(rippleTarget,20,5,5); stage.addEventListener(MouseEvent.MOUSE_MOVE,onmousemoveTriggered); timer.addEventListener(TimerEvent.TIMER, onTimerTriggered); } private function onmousemoveTriggered(e:MouseEvent):void { myRippler.drawRipple(rippleTarget.mouseX,rippleTarget.mouseY,20,1); } private function onTimerTriggered(e:TimerEvent):void { var posX:Number=Math.random()*640; var posY:Number=Math.random()*480; myRippler.drawRipple(posX,posY,15,5); } } } This post has been edited by student123: 28 March 2012 - 08:30 AM
VIEWS ON THIS POST

84

Posted on:

Monday 19th November 2012
View Replies!

.action extensions on the web

university e-library's site.. Saw an extension on a web page (home.action) what language was used to develop that page
VIEWS ON THIS POST

50

Posted on:

Tuesday 27th November 2012
View Replies!

Internet Explorer 8 and Flash...

Everyone. This is the code I used: home_btn.addEventListener(MouseEvent.MOUSE_DOWN, function(evt:MouseEvent):void { var url1:String = "pages/home.html"; var request1:URLRequest = new URLRequest(url1); try { navigateToURL(request1, 'main_frame'); // second argument is target } catch (e:Error) { trace("Error occurred!"); } } ); 'home_btn" is a button in a flash header I made. It connects to a html page., 'home page'. The HTML page has a iFrame with a name and id of 'main_frame'. When I previewed the site in firefox the button linked to 'main_frame'(iFrame) loaded in the iframe target. But in Internet Explorer 8 the same button opened the home page in a separate window... How do I fix this. I work in Adobe Dreamweaver CS4 and just added the .swf file in the HTML site. Please help...
VIEWS ON THIS POST

45

Posted on:

Friday 30th November 2012
View Replies!

unload mp3 from soundChannel?

A quick question, Is there any way to unload an mp3 from the Sound class in as3 Nulling the channel or object doesn't seem to do it, for instance if i load a song in my media player (which is what im trying to build) , it will run just fine, if i click to play another/next song they will both be playing at the same time which obviously would be quite annoying. This post has been edited by heady89: 03 March 2011 - 07:24 PM
VIEWS ON THIS POST

55

Posted on:

Friday 30th November 2012
View Replies!

is it possible to pass a Sprite as a paremeter for a Mouse Event?

private function onclick( evt:Event, box:Sprite ):void { //
VIEWS ON THIS POST

47

Posted on:

Friday 30th November 2012
View Replies!

loading images

Im wondering how to treat the loader, I've a bunch of image links put together by xml data and I am trying to create some thumbnails and display them on my stage(spriteContainer). I only get one image displayed, is it simply overwriting each image here, resulting in only the last one public function LoadImages(imgArray:Array):void { this.loaderImage = new Loader(); this.loaderImage.contentLoaderInfo.addEventListener(Event.COMPLETE, OnCompleteImageLoad); this.loaderImage.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onprogressImageLoad); for each(var image in imgArray) { this.loaderImage.load(new URLRequest(image)); } } public function OnCompleteImageLoad(e:Event):void { if(count == 0) { this.xLead = 0; } else { this.xLead += tWidth + spacing; } if(count == 8) { xLead = 0; yLead += tHeight + spacing; count = 0; } this.loaderImage.width = this.tWidth; this.loaderImage.height = this.tHeight; this.loaderImage.x = this.xLead; this.loaderImage.y = this.yLead; this.count++; // Adding for view spriteContainer.addChild(this.loaderImage); } public function onprogressImageLoad(e:ProgressEvent):void { // Future loading stuff } This post has been edited by heady89: 11 February 2011 - 09:41 AM
VIEWS ON THIS POST

62

Posted on:

Friday 30th November 2012
View Replies!

Com. Bug?

I use ActionScript 2.0. I am trying to make a code for a basic platformer, but my computer keeps on freezing up because of some script. If there is anything wrong with the following script: onClipEvent(load){ speed = 5; gravity = 0: jumping = false; jumpheight = 15; r = _height/2; } onClipEvent(enterFrame){ if(Key.isDown(Key.LEFT){ _x -= speed; } if(Key.isDown(Key.RIGHT){ _x += speed; } if(Key.isDown(Key.UP){ gravity -= jumpheight; } if(!_root.ground.hitTest(_x,_y,true)){ gravity ++; }else { gravity = 0; } if(_root.ground.hitTest(_x,_y-1,true) && !jumping){ _y ++; } }
VIEWS ON THIS POST

65

Posted on:

Friday 30th November 2012
View Replies!

Array, functions and colors

I'm having some problems with my homework related to the ActionScript code. What I want to do is to have a car that goes from the top of the screen to the bottom; every time it appears/reappears on the screen I would like it to randomly select one of the predefined colors as to give the impression it's another car. Here's my code: /* Scene 1 > Layer: car */ var colors:Array = new Array { 0xFF0000, // red 0x0000FF // blue 0xFF6600 // orange }; var randNumber:int = (Math.random() % 3); car.SetColor(colors[randNumber]) ; /* Scene 1 > masina > Layer: Layer 1 Note: the object 'masina' is the car. */ function SetColor(pColor:int) { caros.tabla.transform.ColorTransform.color = pColor; } These are the errors I'm getting: QuoteScene 1, Layer 'car', Frame 1, Line 1: 1086: Syntax error: expecting semicolon before leftbrace. Scene 1, Layer 'car', Frame 1: Syntax error: expecting rightbrace before end of program.
VIEWS ON THIS POST

58

Posted on:

Friday 30th November 2012
View Replies!

FullPath question

, Please, I would like to know the following: - I have a C#app with the swf object embedded my question is : How I can pass full path flv file using .LoadMovie method. e.g. .../myFlvPlayerparam=*/swineflu.flv * here how can I specify the drive letter because when I pass in the swf player appears a vertical bar.
VIEWS ON THIS POST

64

Posted on:

Friday 30th November 2012
View Replies!

Wow!

I got bored so i started playing around in flash and created this: http://santaklaws.tripod.com/test.swf (gotta copy and paste into new browser because Tripod is gay) that little man doesn't change size, but it looks like he shrinks!
VIEWS ON THIS POST

57

Posted on:

Friday 30th November 2012
View Replies!

Http://www.gamespark.tk

Hiya all, not posted for a while, been remaking me site - i'd appreciate any comments you have! Cheers, Lenny x p.s. server's running slowly atm EDIT: noticed a big fault, i'll sort that out first, sorry! This post has been edited by lenny: 04 August 2004 - 04:18 AM
VIEWS ON THIS POST

90

Posted on:

Friday 30th November 2012
View Replies!

textArea

Im so dumb in as3. I have been trying to figure out the difference between textArea enabled and editable I have been reading the docs but im such a noob i cant figure out for myself.
VIEWS ON THIS POST

73

Posted on:

Friday 7th December 2012
View Replies!

php variables help

I have a database that has all my news information for my website...the first question is how do I get the variables from the php into the AS3 code and then display them in a text area named output_txt would i first use URLLoader then when the file is loaded set a listerner for that
VIEWS ON THIS POST

41

Posted on:

Friday 28th December 2012
View Replies!

Baron von Typesfast

Baron von Typesfast Practice Your Typing! http://www.funtotype.com/game/baron-von-typesfast Yay, I released my first major game! I only started learning actionscript/flash around 3 months ago, so I'm pretty happy with it. What do you think
VIEWS ON THIS POST

74

Posted on:

Friday 28th December 2012
View Replies!

Cue Points

Im really stuck and need some help... I have flv's playing externally on a single flash frame. I need another flv to play when the playing flv hits a particular frame within the single frame. I have being looking at cue points and it properties but cant seem to find anything appropriate. Can anyone lend a hand to show me if this is even possible. I have some code if needed...
VIEWS ON THIS POST

44

Posted on:

Friday 28th December 2012
View Replies!

Scripts Not working after frame 1

Hi I need a little bit of help. I'm making a prototype game for a Uni project and so far I have setup classes and movie clips for navigation of the menu screens. I have my movie clips all declared in the Document main file and positioned on the Stage. Everything seems to work fine at first but then when I try to go back to the title screen from say the help screen the buttons on the title screen(frame1 BTW) stop working.
VIEWS ON THIS POST

48

Posted on:

Friday 28th December 2012
View Replies!

Knowing when an object moved... Globally

, I saw this question a few times here and there but it never had a satisfying answer... It may be that there really is no elegant way to solve this (Polling for change in ENTER_FRAME is really bad!) but I've got to ask one last time. I'm a Flex developer but it doesn't really matter in this case. I would like to know when an object's global x/y was modified (or its transform's concatenated matrix's tx/ty, same thing), maybe because an indirect parent somewhere moved, etc. In particular, I have the object's gran gran gran parent which gets its scrollrect changed. Any brilliant idea in 2011
VIEWS ON THIS POST

40

Posted on:

Friday 28th December 2012
View Replies!

AS3 - width, hitTestObject

Hi There, Having a problem that has been bugging me for the past day or so and can't figure out exactly what is going on. On the stage, I have two squares (name a and b) with no borders (linestyle), when using the selection tool tells me height, width are 50x50 each. The first object is placed at 212,120 and the second object is at 285,119. I then run the following code: ------------ a.x = 50; b.x = a.x + a.width; a.y = b.y = 100; trace("width: " + a.width, b.width ); trace("x: " + a.x, b.x ); if (a.hitTestObject(b) ) { trace("b hits a") }; --------------- Visually the two squares are side-by-side with no overlap; checked by zooming at 400%. But the code returns with a "b hits a". Here is the output: width: 50 50 x: 50 100 b hits a Why would hitTestObject come back true if the objects are side by side with no apparent overlap. If they are apart by 1 pixel then hitTestObject does return with a false. Can anyone provide some insight
VIEWS ON THIS POST

68

Posted on:

Friday 28th December 2012
View Replies!

Flash mouse over event fades out the rest of website

I am pretty new to the whole Flash and AS, but needs must, so I am struggling I am trying to create a simple website with buttons that react a similar way as here: http://www.42angels.com Basically, when a visitor hovers over a button of the menu, the rest of the page fades out. How is this action done
VIEWS ON THIS POST

46

Posted on:

Saturday 29th December 2012
View Replies!

Decrease Number exponentially(or at rate) via AS3?

I am making (just for the sake of boredom and practice), a 'generator' of sorts, where as you drag the mouse along it will create a path of circles behind it along the path. The problem i am having is i want to make the size of the circles decrease in size at an exponential rate(so as the size of the circles decrease, the slower the rate of the decrease). The math is becoming difficult to figure out. Here is my Code: Code: import flash.events.TimerEvent; import flash.display.Sprite; //Mouse.hide(); var rate:int = 10; stage.addEventListener(MouseEvent.MOUSE_MOVE, create); var ballInd:int = 0; var ballMov:Array = new Array(); var spacing = 0; var max:int = 15; var amt:int = 0; var startSize = 30; function create(e:MouseEvent) { spacing++; if (spacing == 5) { if (amt < max) { spacing = 0; amt++; ballMov[ballInd] = new ball(); ballMov[ballInd].x = mouseX; ballMov[ballInd].y = mouseY; ballMov[ballInd].width = \t; ballMov[ballInd].height = \t; this.addChild(ballMov[ballInd]); } ballInd++; } }
VIEWS ON THIS POST

64

Posted on:

Saturday 29th December 2012
View Replies!

Is it possible to change publish settings using AS3?

Is it possible to change the publish settings - specifically, the file path and name of the exported swf - using Actionscript Or must they always be set in the Publish Settings dialogue box Nothing I've seen indicates it can be done, but I thought I'd make sure.
VIEWS ON THIS POST

49

Posted on:

Sunday 30th December 2012
View Replies!

super?

what does super(null) mean
VIEWS ON THIS POST

47

Posted on:

Sunday 30th December 2012
View Replies!

flash and htaccess

Hi all Apologies if this is not in the correct forum.... I am trying to stop access to the jpgs on my site using the following htaccess RewriteEngine on RewriteCond %{HTTP_REFERER} !^http(s)://(www\.)mysite.com\index.html [NC] RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L] However, this is stopping the images being loaded into my flash site. This is only happening for some users, not all. Any ideas would be appreciated Cheers
VIEWS ON THIS POST

45

Posted on:

Sunday 30th December 2012
View Replies!

I can't get my xml data out of the onload function

I can't figure out why this doesn't work. I need to pass the text in the xml file to an object that needs to be created outside of the onload function so i need access to the data out side of that function. I've declared variables to store the data at the class level which i thought would give me access to the data please help. below is the code: Code: package { import flash.display.MovieClip; import flash.display.Loader; import flash.events.*; import flash.net.URLLoader; import flash.net.URLRequest; import flash.xml.*; public class Test extends MovieClip { private var tlbXML:XML; private var tlbNode3:String; public function Test() { init(); } function init(){ var tlbLoader:URLLoader = new URLLoader(); tlbLoader.load(new URLRequest("tlbContent.xml")); tlbLoader.addEventListener(Event.COMPLETE, processTlbXML); } function processTlbXML(e:Event):void { var tlbXML = new XML(e.target.data); tlbNode3 = tlbXML.tlb.node3.toString(); //trace works here trace(tlbNode3 + " = tlbNode3"); } //trace doesn't works here trace(tlbNode3 + " = tlbNode3"); }
VIEWS ON THIS POST

82

Posted on:

Sunday 30th December 2012
View Replies!

Help in random function

i want to make random number between 1 to 10 without repate numbet twice or more i use this function to make random function getRandomNumber(min:Number, max:Number):Number { var randomNumber:Number = Math.round(Math.random() * (max - min) + min); return randomNumber; } getRandomNumber(1, 10); please help
VIEWS ON THIS POST

72

Posted on:

Sunday 30th December 2012
View Replies!

What will be the stage width and height?

I have a Bkg_mc which is registered to top left corner. Now, how can I change the code to keep my Bkg_mc top left corner when the browser window resizes. The following is the code: Code: stage.addEventListener(Event.RESIZE, resizeListener); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; Bkg.x = stage.stageWidth/2; Bkg.y = stage.stageHeight/2; function resizeListener (e:Event):void { } The lines to be modified here are: Bkg.x = stage.stageWidth/2; Bkg.y = stage.stageHeight/2;
VIEWS ON THIS POST

42

Posted on:

Sunday 30th December 2012
View Replies!

Assigned numbers to movie clip to plug in formula... not working

So I am attempting to vertically evenly space these movie clips so I came up with a math formula involving n( the button number) but Its not working. Here is my code: var buttonArray:Array = [ side_banner.btn1, side_banner.btn2, side_banner.btn3, side_banner.btn4]; var buttonCount:uint = buttonArray.length; for (var i:uint=0; i< buttonCount; i++) { buttonArray[i].addEventListener(MouseEvent.CLICK, outputNumber); buttonArray[i].theTrigger = [i + 1]; } } function outputNumber(e:MouseEvent):void { trace( e.target.theTrigger); buttonArray[i].y = (((stage.stageHeight - 400)/4)*(e.target.theTrigger)) - ((stage.stageHeight - 400)/4)/2 } But apparently each movie clip doesn't actually have a numerical value just a numeric name... how can I get the "n" btn number to use my formula
VIEWS ON THIS POST

46

Posted on:

Monday 31st December 2012
View Replies!

sound from flvPlayback won't stop

I have a website http://www.droolpigs.com when I go there if I click the video archives button then play a video then click on the home or photos button or one of the alternate background buttons on the left the video goes away as it should but not always the audio (especially when I click while the video is still buffering). Is there a command I can use to kill the sound from the flvPlayback component and nothing else(I have a mp3 player there also I so I don't want to use the SoundMatrix class. btw the videos are all played on an instance of the flvPlayback component.
VIEWS ON THIS POST

65

Posted on:

Monday 31st December 2012
View Replies!

Flash as3 perform function automatically?

, I'm new to AS3 and having a bit of trouble with listeners. The file consists of 3 buttons and 3 input fields. Clicking either of the first 2 buttons will place a specific number in one of the 2 corresponding input fields. The third button adds the previous 2 values and displays the result in the 3rd input field. The fields themselves are uneditable and only for displaying the numbers. My question is what is the correct listener/function to have the "total" function perform automatically when either of the first 2 text fields change in value...or if this is even possible.....any help would be greatly appreciated.... The code below works as written... b_total.addEventListener(MouseEvent.MOUSE_DOWN, total); b01.addEventListener(MouseEvent.MOUSE_DOWN, button01); b02.addEventListener(MouseEvent.MOUSE_DOWN, button02); // // var input01:String; var input02:String; var plus:Number; // // love01.text = "0"; love02.text = "0"; love_total.text = "0"; // // function button01(event:MouseEvent):void{ love01.text = ("14"); } function button02(event:MouseEvent):void{ love02.text = ("8"); } function total(event:MouseEvent):void{ input01=love01.text; input02=love02.text; plus = parseInt(input01) + parseInt(input02); plus.toString(); love_total.text = String(plus); }
VIEWS ON THIS POST

32

Posted on:

Monday 31st December 2012
View Replies!

Disappearing Dynamic Image on Timeline

I'm relatively new to AS3, but have done a lot of work with AS2, so please forgive me if I'm not using the right terminology with this.... I've created a button that I turned into a library class and am pulling onto my stage (same as attachMovie is AS2). This button has a timeline which does a small amount of animation. In my AS, I am loading a thumbnail into each button class and am also assigning mouseevents of roll_over and roll_out to my button... this all is working so far. On roll_over the button's timeline plays to a point; on roll_out, the button's timeline plays to the end and then goes back to the first frame.... BUT now my image is gone. Why\t\t Thanx in advance! Here is my AS: Code: for(var c:int=0; c
VIEWS ON THIS POST

50

Posted on:

Monday 31st December 2012
View Replies!

Help me in this project

Dear all, I did Product catalog, it contents intro and supportive files (.swf) how to give non editable file to them. or it should ask to install to run this catalog but the supportive file should not visible and edit.
VIEWS ON THIS POST

223

Posted on:

Thursday 3rd January 2013
View Replies!

how to delelte mc in as3

Hi , How can i delete mc in as3. I know the option "removeChild", in this the mc is not deleted, it is removed from the stage or from any mc. it still exists. Suppose, I am creating mc's dynamically from a loop say enter frame, the no of mc will go on increase till the loop continues and it occupies space, and reduces the animation speed(if i give animation for the new mc's). I know this is done in as2. Please help me for getting done in as3.
VIEWS ON THIS POST

289

Posted on:

Thursday 3rd January 2013
View Replies!