# swf decompile

**URL:** https://forum.kirupa.com/t/swf-decompile/634440
**Category:** flash
**Created:** [April 7, 2016, 5:56am UTC](https://forum.kirupa.com/t/swf-decompile/634440 "2016-04-07T05:56:00Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 7, 2016, 5:56am UTC](https://forum.kirupa.com/t/swf-decompile/634440/1 "2016-04-07T05:56:01Z")

</div>

Hi All.

i am having swf file which shows me the Title of currently playing video by one application. i wanted to change the theme and design. but i am unable to write script for it. anyone help me to do it!

Thanks in advance… i decompiled the swf and get the following script but not getting if i done with new file.

[Orignal file](http://www.4shared.com/document/rmuo-w4rce/MovieTitle0001.html)

decompiled script -

var Header; var Title; var TitleFont; var TitleFormat = new textformat(); \_root.onenterframe = function () { if (\_root.\_currentframe == 2) { txtHeader.text = Header; txtTitle1.text = Title; TitleFormat.font = TitleFont; txtTitle1.settextformat(TitleFormat); } };

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [April 7, 2016, 6:35am UTC](https://forum.kirupa.com/t/swf-decompile/634440/2 "2016-04-07T06:35:04Z")

</div>

Looking at the provided code, It looks like the swf use flashvars?

The Title is served to the swf by the html document. So you have a videoplayer in the swf together with some vars to handle the text.

Read this documentation on flashvars:  
[https://helpx.adobe.com/flash/kb/pass-variables-swfs-flashvars.html](https://helpx.adobe.com/flash/kb/pass-variables-swfs-flashvars.html)

---

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 7, 2016, 7:34am UTC](https://forum.kirupa.com/t/swf-decompile/634440/3 "2016-04-07T07:34:50Z")

</div>

Thanks… exactly what i though… but i created the Swf file. and try to integrate in appliocation but the script not working…

can we get the variable name from the above swf file or script from above file?

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [April 7, 2016, 8:35am UTC](https://forum.kirupa.com/t/swf-decompile/634440/4 "2016-04-07T08:35:08Z")

</div>

The variables seems to be Header and Title.

In theory flashvars should be very straight forward, (but I remember working on it for a whole day just to get it to work, and this was back in the days flash was widely spread).

There is SWFOjbect you could use instead, I think was more solid than the examples in Adobe documentation. Still, last update was 3 years ago:

> **[swfobject/swfobject](https://github.com/swfobject/swfobject)**
>
> swfobject - An open source Javascript framework for detecting the Adobe Flash Player plugin and embedding Flash (swf) files.

---

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 7, 2016, 9:23am UTC](https://forum.kirupa.com/t/swf-decompile/634440/5 "2016-04-07T09:23:32Z")

</div>

Thanks Linusj, but problem is the application developed in VB. and dont know how he integrated the flash variables to be accessed. now only i can work with swf script by which it get update cant we use the script from the above file?

as i am not so familiar about action-script. i tried with copy of same script but its not working.

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [April 7, 2016, 12:00pm UTC](https://forum.kirupa.com/t/swf-decompile/634440/6 "2016-04-07T12:00:27Z")

</div>

You should be able to use the same variables in the swf. The actionscript version is as2. There must be something broken in your decompile.

I can’t look at your swf and I dont have a swf decompiler. Do you have a .fla file? I think you can post it here on the forum. I currently only have flash CS5.

---

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 7, 2016, 12:02pm UTC](https://forum.kirupa.com/t/swf-decompile/634440/7 "2016-04-07T12:02:10Z")

</div>

> [@linusj](#):
>
> There must be something broken in your decompile.

Sorry,  
i dont have the fla. only have multiple swf files only… even i thought same. something broken in script. if you want i can post multiple swf files.

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [April 7, 2016, 12:07pm UTC](https://forum.kirupa.com/t/swf-decompile/634440/8 "2016-04-07T12:07:52Z")

</div>

Oh, it looks like I have sothink swf decompiler after all. You can get a trial here.  
[http://www.sothink.com/product/flashdecompiler/?gclid=CNf6-tW-\_MsCFSkocgodCTsF3Q](http://www.sothink.com/product/flashdecompiler/?gclid=CNf6-tW-_MsCFSkocgodCTsF3Q)

If you attach an SWF I can have a look at it.

---

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 7, 2016, 12:11pm UTC](https://forum.kirupa.com/t/swf-decompile/634440/9 "2016-04-07T12:11:07Z")

</div>

in first post have posted the swf file. you can look into it. and thanks for your efforts…

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [April 7, 2016, 12:45pm UTC](https://forum.kirupa.com/t/swf-decompile/634440/10 "2016-04-07T12:45:47Z")

</div>

Im not familiar with 4shared, and I’m not signing in or giving 4shared access to any personal account or email adress.

Could you post it in this thread?

---

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 7, 2016, 4:41pm UTC](https://forum.kirupa.com/t/swf-decompile/634440/11 "2016-04-07T16:41:05Z")

</div>

unable to upload the file as i am new member . will upload it in different filehost server

[download](https://www.mediafire.com/?1cju5dj9i70xtr9)

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [April 7, 2016, 7:06pm UTC](https://forum.kirupa.com/t/swf-decompile/634440/12 "2016-04-07T19:06:27Z")

</div>

@resact

The problem with the file was that the textlayers where not nested in any movieclip, just animated in the root. So whatever was passed to them was replaced at the first keyframe with the text set at that keyframe. Thats why there was an onEnterframe function. But the onEnterFrame didn’t find the text at frame 5. The keyframes where all but there.

So I removed the onEnterFrame function and set all vars in first frame. I don’t think the titlefont does anything? You might just want to remove it?

```
headerMC.txtHeader.text = Header;
titleMC.txtTitle1.text = Title;

//TitleFormat.font = TitleFont;
//titleMC.txtTitle1.setTextFormat(TitleFormat);

```

Try with this one…  
[Download](http://www.mediafire.com/download/icrr381ybzenobq/MovieTitle03.zip)

---

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 8, 2016, 2:09am UTC](https://forum.kirupa.com/t/swf-decompile/634440/13 "2016-04-08T02:09:33Z")

</div>

hi linusj,

your file is working in your html file but in that application its not taking the title of the song. somehere he setting or reading the variable from the application… any method we get before we assign ?

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [April 8, 2016, 6:47am UTC](https://forum.kirupa.com/t/swf-decompile/634440/14 "2016-04-08T06:47:37Z")

</div>

Ok, I had the same problem reopening the .fla file, so a bit strange.

I embedded the font and moved the assign of textfields to frame 5.

There is no method before. According to the documentation you should be able to use the variables as if they where declared on the first frame, but thats just in theory.

Try this one:  
[Download 2](http://www.mediafire.com/download/m1fqlho91ua6spa/MovieTitle03_2.zip)

---

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 8, 2016, 10:22am UTC](https://forum.kirupa.com/t/swf-decompile/634440/15 "2016-04-08T10:22:19Z")

</div>

this works like charm… what was the issue?  
and can you tell hw to create??? and based on this want to read the text from file

like

if Title ==1  
play 1st line from txt file…  
if Title==2  
play second line

and so on…

hope you understand the logic

---

<div class="post-metadata">

### Author: ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)
#### Post date: [April 8, 2016, 12:36pm UTC](https://forum.kirupa.com/t/swf-decompile/634440/16 "2016-04-08T12:36:04Z")

</div>

If you want to change the theme and design, you probably want to do that in adobe flash. (Nowadays I think they renamed it to animate CC?) The fla file you got with the download from me is a flash CS5 file. So you just open it in that program, CS5 or above, and edit the script and timeline.

There are free options, for example [http://www.flashdevelop.org/](http://www.flashdevelop.org/) but I havent used that so much, since there was no mac support back in the days when I used to do flash. From what I understand there is not much of graphic representation in flashdevelop. But it is really good to code actionscript2 and actionscript3. Better than adobe flash.

Reading a textfile from as2, you can use this code:  
[https://www.kirupa.com/forum/showthread.php?376251-Read-text-file-and-use-variables](https://www.kirupa.com/forum/showthread.php?376251-Read-text-file-and-use-variables)

---

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 9, 2016, 4:06am UTC](https://forum.kirupa.com/t/swf-decompile/634440/17 "2016-04-09T04:06:43Z")

</div>

@linusj: Thank you so much for the support and guidance which you given me. thanks alot.

i think in kirupa we dont have PM option.

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [April 9, 2016, 8:39am UTC](https://forum.kirupa.com/t/swf-decompile/634440/18 "2016-04-09T08:39:47Z")

</div>

Pretty sure these Kirupa Forums do have a PM option…

---

<div class="post-metadata">

### Author: ![resact](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@resact](https://forum.kirupa.com/u/resact)
#### Post date: [April 9, 2016, 9:24am UTC](https://forum.kirupa.com/t/swf-decompile/634440/19 "2016-04-09T09:24:40Z")

</div>

yup… i didnt saw that one… thanks.

---

<div class="post-metadata">

### Author: ![codexbd](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@codexbd](https://forum.kirupa.com/u/codexbd)
#### Post date: [August 11, 2016, 11:16pm UTC](https://forum.kirupa.com/t/swf-decompile/634440/20 "2016-08-11T23:16:08Z")

</div>

@linusj: Brother can you please re-up that flash file which you have made.The zip file is corrupted.

Thanks in advance.
