actionscript-3

Action Script - how to go to another scene from movieClip?

百般思念 提交于 2020-07-19 20:42:12
问题 I'm trying to go to another scene by clicking a button witch is placed in a mc and I got an error. This is my code below Play_btn.addEventListener(MouseEvent.CLICK,gotoScene2); function gotoScene2(evt:MouseEvent){ movClip.gotoAndPlay(1,"Scene 2"); } (this code is placed inside a movieClip witch is instantiated like "movClip", at frame 260 - may be this help to understand better). And this is the erorr i get: Symbol 'preloader26',Layer'Layer9',Frame 260,Line 4 1120:Access of undefined property

Change the fontsize of a button's label in Actionscript 3.0

♀尐吖头ヾ 提交于 2020-07-10 03:54:48
问题 Can someone help me change the fontsize of a button's label in actionscript 3? I have a button called "submit" from the components and I was able to change its font using the "setStyle"...But I don't know how to change its fontsize. Is there a code similar to what I have just made? Below is the code on how I change the fontstyle. Any help will be very much appreciated.. submit.label = "Submit"; submit.setStyle("textFormat", new TextFormat("Impact")); 回答1: The second parameter in the

How to pick random element in an array AVOIDING (EXCEPT if it's) a certain value?

℡╲_俬逩灬. 提交于 2020-06-27 15:55:14
问题 For example, when users are connecting to this application they are given a userid var, then it's inserted into the array. So, i'm using chosenUser = usersOnlineArray[Math.round((Math.random()*usersOnlineArray.length))]; to pick another random user. But i need to make sure it doesn't pick the userID they personally were assigned so they don't end up getting themselves. how would i use that code but tell it to "remember, make sure you don't pick userid" maybe I could do something like

Is it possible to add a attachment to a mail with the mailto function in actionscript 3?

£可爱£侵袭症+ 提交于 2020-06-14 07:10:52
问题 Is it possible to add a attachment to a mail with the mailto function in actionscript 3? Thats the thing, i want to open the default mail program compose window with some data but i also need to add a file as attachment, and that file must be a screen capture of the app. Im doing some research and cant find nothing even close to this, someone have any ideas? All help will be appreciated because im really lost here. Thanks in advance ;) Edit: public function onClickEmail(event:MouseEvent):void

How reading exif metadata from file

给你一囗甜甜゛ 提交于 2020-05-17 08:47:09
问题 I'm trying to implement the following Exif reading library with as3, but I can't load the browsed file. In the library example they use loader.load(new URLRequest("http://www.example.com/sample.jpg")); for loading the image, the problem in my application is that the file is selected by a file-browser in a local computer. I tried a fileReference.name but it doesn't work, the only way that I found to make my test, is putting a file in the same directory than the .swf like this : loader.load(new

How reading exif metadata from file

有些话、适合烂在心里 提交于 2020-05-17 08:46:58
问题 I'm trying to implement the following Exif reading library with as3, but I can't load the browsed file. In the library example they use loader.load(new URLRequest("http://www.example.com/sample.jpg")); for loading the image, the problem in my application is that the file is selected by a file-browser in a local computer. I tried a fileReference.name but it doesn't work, the only way that I found to make my test, is putting a file in the same directory than the .swf like this : loader.load(new

Efficient collision detection in AS3

时光怂恿深爱的人放手 提交于 2020-04-30 10:58:16
问题 I have a problem with a game that I'm doing. I basically have objects that are in a map and I have to check for each of them if they collide with the walls (and then do something). Since was working with AS2, I thought about doing the same way: I drew a picture with only the walls, so with only rectangles and everything else in between is transparent (does not exist, then the floor for example). In AS2 I put the image to the screen, let's call it wall, and then I did a hitTest to wall with

Efficient collision detection in AS3

谁说我不能喝 提交于 2020-04-30 10:57:18
问题 I have a problem with a game that I'm doing. I basically have objects that are in a map and I have to check for each of them if they collide with the walls (and then do something). Since was working with AS2, I thought about doing the same way: I drew a picture with only the walls, so with only rectangles and everything else in between is transparent (does not exist, then the floor for example). In AS2 I put the image to the screen, let's call it wall, and then I did a hitTest to wall with

AS3 Bingo ticket generator

感情迁移 提交于 2020-04-18 06:51:32
问题 I'm trying to make a Bingo ticket (Housie) generator, but I've got some problems. Normally, each row contains five numbers and four blank spaces randomly distributed along the row. Numbers are apportioned by column (1–9, 10–19, 20–29, 30–39, 40–49, 50–59, 60–69, 70–79, and 80–90). My generator looks like this: As you can see, I can't manage to have 5 numbers per row. My code is the following (I'm using the RandomPlus class): package com.demstra.Ticket { import flash.display.MovieClip; public

Trying to send an HTTP request over sockets

谁都会走 提交于 2020-04-16 05:49:11
问题 I'm having trouble sending out a simple HTTP request using Actionscript 3's Socket() object. My onConnect listener is below: function sConnect(e:Event):void { trace('connected'); s.writeUTFBytes('GET /outernet/client/rss/reddit-feeds HTTP/1.1\r\n'); s.writeUTFBytes('Host: 208.43.71.50:8080\r\n'); s.writeUTFBytes('Connection: Keep-alive\r\n'); s.flush(); } Using a packet sniffer, I can see the request does indeed get sent to the server, but the packet sniffer doesn't identify the protocol as