Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411613 Posts in 69390 Topics- by 58447 Members - Latest Member: sinsofsven

May 10, 2024, 01:56:53 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Rinku & Increpare (and more?) Learn Flash
Pages: 1 ... 27 28 [29]
Print
Author Topic: Rinku & Increpare (and more?) Learn Flash  (Read 76509 times)
bateleur
Level 10
*****



View Profile
« Reply #560 on: October 04, 2009, 11:56:26 PM »

AIR requires familiarity with MXML though.
Not in order to do what dustin needs, no.

After installing AIR you can just set the player for a particular project to "AIR 1.1" and all the AIR libraries become available to any AS3 script.
Logged

Draknek
Level 6
*


"Alan Hazelden" for short


View Profile WWW
« Reply #561 on: October 05, 2009, 09:02:40 AM »

Flash 10 has file reading/writing functionality, which should work whether it's online or downloaded.

http://www.thedesilva.com/2008/11/flash-10-file-reference/

http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/net/FileReference.html
Logged

mirosurabu
Guest
« Reply #562 on: December 14, 2009, 03:05:24 PM »

Ok, here is a problem and I will be glad if anyone can help me with it. (:

(I use Flex)

Namely, I want to extend an existing MovieClip (imported from SWC) which has a timeline.

The first frame has a bunch of buttons in it with no code. (this is GUI)

2-45 frames is some animation.

46-90 frames is another animation.

I want to extend this movieclip in order to add event listeners to the buttons located in the first frame. I extend the class, add event listeners in constructor and call gotoAndStop(1).

This all works fine.

However, once I move the playhead to any other frame and go back to the first frame of the movieclip the buttons don't work anymore (and if I try to access them I get the "null reference" error).

What's happening here? :/
Logged
Glaiel-Gamer
Guest
« Reply #563 on: December 14, 2009, 05:13:14 PM »

What's happening here? :/

Flash giving you near no control over the order it does things in Tongue.

If the code is in the timeline, move the code one frame later, and keep the buttons on the first frame.

If the code is from elsewhere, execute it in a RENDER event, not an enterframe event (also call stage.invalidate in the enterframe event)
Logged
mirosurabu
Guest
« Reply #564 on: December 14, 2009, 09:31:39 PM »

Hey, thanks for the answer!

That sounds like a lot of hassle. I tried moving code from enterframe to render event and placing stage.invalidate(); in enterframe event. Doesn't work.

There is no code in the imported movieclip except for three frame scripts all containing stop(); (scripts placed at frames 1, 45 and 90). I'll try removing that code, but not sure it's the cause of the problem. :/

EDIT:

Removed frame scripts; no change whatsoever.

The problem seems to be related to event listeners.

This code

gotoAndStop(2);
gotoAndStop(1);

results in a "null reference" error as I try to access one of the buttons from the first frame in enterframe. Clicking continue reveals that these buttons do become accessible at some point but event listeners remain dead.

If I copy the code that adds event listeners to the "ENTERFRAME event" the problem is solved. (except for the "null reference error")

:/
« Last Edit: December 14, 2009, 09:49:03 PM by Miroslav Malešević » Logged
Glaiel-Gamer
Guest
« Reply #565 on: December 14, 2009, 10:24:36 PM »

gotoAndStop(2);
gotoAndStop(1);

results in a "null reference" error as I try to access one of the buttons from the first frame in enterframe. Clicking continue reveals that these buttons do become accessible at some point but event listeners remain dead.

This is EXACTLY what the Render event is for. When you call gotoAndStop, the changes to the timeline aren't updated until after the enterframe event exits. Then the render event is called (immediately before the stage is rendered, and after the timeline is updated. I think).
Logged
mirosurabu
Guest
« Reply #566 on: December 14, 2009, 11:55:55 PM »

Yeah, I solved that one by placing goto's at the end of the function.

As for event listeners, thanks goodness I solved that one by using addFrameScript().
Logged
mirosurabu
Guest
« Reply #567 on: December 16, 2009, 11:24:36 PM »

New problem. :/ Actually it's not new, but it's equally annoying.

Flex is eating the characters from static text in imported movieclips (SWC's). :/

And I can't figure out what's the cause of this?
Logged
Pages: 1 ... 27 28 [29]
Print
Jump to:  

Theme orange-lt created by panic